n = int(input())
S = input()

r = S.count('R')
w = len(S)-r

if r == 0 or w == 0:
    print(0)
    exit()

ans = 0
for i in range(len(S)):
    if S[i] == "R":
        r -= 1
    else:
        r -= 1
        w -= 1
        ans += 1
    if r == 0 or w == 0:
        break
print(ans+r) n = int(input()) n int(input()) int input() input S = input() S input() input r = S.count('R') r S.count('R') S.count S count 'R' w = len(S)-r w len(S)-r len(S) len S r if r == 0 or w == 0:
    print(0)
    exit() r == 0 or w == 0 r == 0 r 0 w == 0 w 0 print(0) print 0 exit() exit ans = 0 ans 0 for i in range(len(S)):
    if S[i] == "R":
        r -= 1
    else:
        r -= 1
        w -= 1
        ans += 1
    if r == 0 or w == 0:
        break i range(len(S)) range len(S) len S if S[i] == "R":
        r -= 1
    else:
        r -= 1
        w -= 1
        ans += 1
     S[i] == "R" S[i] S i "R" r -= 1 r 1 r -= 1 r 1 w -= 1 w 1 ans += 1 ans 1 if r == 0 or w == 0:
        break r == 0 or w == 0 r == 0 r 0 w == 0 w 0 break print(ans+r) print ans+r ans r r -= 1 1 r ans = 0 0 ans ans += 1 1 ans r -= 1 1 r r = S.count('R') S.count('R') r w -= 1 1 w S = input() input() S n = int(input()) int(input()) n w = len(S)-r len(S)-r w
n = int(input())
S = input()

r = S.count('R')
w = len(S)-r

if r == 0 or w == 0:
    print(0)
    exit()

ans = 0
for i in range(len(S)):
    if S[i] == "R":
        r -= 1
    else:
        r -= 1
        w -= 1
        ans += 1
    if r == 0 or w == 0:
        break
print(ans+r)