import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


def ceil(a, b): return (a + b - 1) // b


inf = float('inf')
mod = 10 ** 9 + 7


def pprint(*A):
    for a in A:     print(*a, sep='\n')


def INT_(n): return int(n) - 1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [I() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    N = I()
    c = input()
    start = 0
    end = N - 1
    ans = 0
    is_end = True
    while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
    if not is_end and c[start] == 'W':
        ans += 1
    print(ans)


if __name__ == '__main__':
    main() import sys sys sys.setrecursionlimit(10 ** 6) sys.setrecursionlimit sys setrecursionlimit 10 ** 6 10 6 input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline from math import floor, sqrt, factorial, hypot, log from heapq import heappop, heappush, heappushpop from collections import Counter, defaultdict, deque from itertools import accumulate, permutations, combinations, product, combinations_with_replacement from bisect import bisect_left, bisect_right from copy import deepcopy from fractions import gcd from random import randint def ceil(a, b): return (a + b - 1) // b ceil a a b b inf = float('inf') inf float('inf') float 'inf' mod = 10 ** 9 + 7 mod 10 ** 9 + 7 10 ** 9 10 9 7 def pprint(*A):
    for a in A:     print(*a, sep='\n') pprint for a in A:     print(*a, sep=' a A *A def INT_(n): return int(n) - 1 INT_ n n def MI(): return map(int, input().split()) MI def MF(): return map(float, input().split()) MF def MI_(): return map(INT_, input().split()) MI_ def LI(): return list(MI()) LI int(x) - 1 for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) - 1 int(x) int x 1 def LI_(): return [int(x) - 1 for x in input().split()] LI_ def LF(): return list(MF()) LF I() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) I() I def LIN(n: int): return [I() for _ in range(n)] LIN n: int n LI() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI() LI def LLIN(n: int): return [LI() for _ in range(n)] LLIN n: int n LI_() for _ in range(n) for _ in range(n) _ range(n) range n for _ in range(n) LI_() LI_ def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ n: int n list(map(int, l.split())) for l in input() for l in input() l input() input for l in input() list(map(int, l.split())) list map(int, l.split()) map int l.split() l.split l split def LLI(): return [list(map(int, l.split())) for l in input()] LLI def I(): return int(input()) I def F(): return float(input()) F def ST(): return input().replace('\n', '') ST def main():
    N = I()
    c = input()
    start = 0
    end = N - 1
    ans = 0
    is_end = True
    while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
    if not is_end and c[start] == 'W':
        ans += 1
    print(ans) main N = I() N I() I c = input() c input() input start = 0 start 0 end = N - 1 end N - 1 N 1 ans = 0 ans 0 is_end = True is_end True while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
     start != end start end if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
     is_end if c[end] == 'R':
                is_end = False
             c[end] == 'R' c[end] c end 'R' is_end = False is_end False end -= 1 end 1 if c[start] == 'W':
                is_end = True
                ans += 1
             c[start] == 'W' c[start] c start 'W' is_end = True is_end True ans += 1 ans 1 start += 1 start 1 if not is_end and c[start] == 'W':
        ans += 1
     not is_end and c[start] == 'W' not is_end is_end c[start] == 'W' c[start] c start 'W' ans += 1 ans 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def I(): return int(input()) def I(): return int(input()) I def LF(): return list(MF()) def LF(): return list(MF()) LF def LI_(): return [int(x) - 1 for x in input().split()] def LI_(): return [int(x) - 1 for x in input().split()] LI_ def MF(): return map(float, input().split()) def MF(): return map(float, input().split()) MF def MI_(): return map(INT_, input().split()) def MI_(): return map(INT_, input().split()) MI_ def LLIN_(n: int): return [LI_() for _ in range(n)] def LLIN_(n: int): return [LI_() for _ in range(n)] LLIN_ def main():
    N = I()
    c = input()
    start = 0
    end = N - 1
    ans = 0
    is_end = True
    while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
    if not is_end and c[start] == 'W':
        ans += 1
    print(ans) def main():
    N = I()
    c = input()
    start = 0
    end = N - 1
    ans = 0
    is_end = True
    while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
    if not is_end and c[start] == 'W':
        ans += 1
    print(ans) main def LLIN(n: int): return [LI() for _ in range(n)] def LLIN(n: int): return [LI() for _ in range(n)] LLIN def F(): return float(input()) def F(): return float(input()) F def ceil(a, b): return (a + b - 1) // b def ceil(a, b): return (a + b - 1) // b ceil input = sys.stdin.readline sys.stdin.readline input def LIN(n: int): return [I() for _ in range(n)] def LIN(n: int): return [I() for _ in range(n)] LIN def pprint(*A):
    for a in A:     print(*a, sep='\n') def pprint(*A):
    for a in A:     print(*a, sep='\n') pprint def INT_(n): return int(n) - 1 def INT_(n): return int(n) - 1 INT_ def ST(): return input().replace('\n', '') def ST(): return input().replace('\n', '') ST mod = 10 ** 9 + 7 10 ** 9 + 7 mod def LI(): return list(MI()) def LI(): return list(MI()) LI inf = float('inf') float('inf') inf def LLI(): return [list(map(int, l.split())) for l in input()] def LLI(): return [list(map(int, l.split())) for l in input()] LLI def MI(): return map(int, input().split()) def MI(): return map(int, input().split()) MI
import sys

sys.setrecursionlimit(10 ** 6)
input = sys.stdin.readline
from math import floor, sqrt, factorial, hypot, log  # log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter, defaultdict, deque
from itertools import accumulate, permutations, combinations, product, combinations_with_replacement
from bisect import bisect_left, bisect_right
from copy import deepcopy
from fractions import gcd
from random import randint


def ceil(a, b): return (a + b - 1) // b


inf = float('inf')
mod = 10 ** 9 + 7


def pprint(*A):
    for a in A:     print(*a, sep='\n')


def INT_(n): return int(n) - 1


def MI(): return map(int, input().split())


def MF(): return map(float, input().split())


def MI_(): return map(INT_, input().split())


def LI(): return list(MI())


def LI_(): return [int(x) - 1 for x in input().split()]


def LF(): return list(MF())


def LIN(n: int): return [I() for _ in range(n)]


def LLIN(n: int): return [LI() for _ in range(n)]


def LLIN_(n: int): return [LI_() for _ in range(n)]


def LLI(): return [list(map(int, l.split())) for l in input()]


def I(): return int(input())


def F(): return float(input())


def ST(): return input().replace('\n', '')


def main():
    N = I()
    c = input()
    start = 0
    end = N - 1
    ans = 0
    is_end = True
    while(start != end):
        if is_end:
            if c[end] == 'R':
                is_end = False
            end -= 1
        else:
            if c[start] == 'W':
                is_end = True
                ans += 1
            start += 1
    if not is_end and c[start] == 'W':
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()