N = int(input())
s = input()

w = 0
r = s.count('R')
ans = min(N, r)

for i in range(N):
    if s[i] == 'R':
        r -= 1
    else:
        w += 1
    ans = min(ans, max(w, r))

print(ans) N = int(input()) N int(input()) int input() input s = input() s input() input w = 0 w 0 r = s.count('R') r s.count('R') s.count s count 'R' ans = min(N, r) ans min(N, r) min N r for i in range(N):
    if s[i] == 'R':
        r -= 1
    else:
        w += 1
    ans = min(ans, max(w, r)) i range(N) range N if s[i] == 'R':
        r -= 1
    else:
        w += 1
     s[i] == 'R' s[i] s i 'R' r -= 1 r 1 w += 1 w 1 ans = min(ans, max(w, r)) ans min(ans, max(w, r)) min ans max(w, r) max w r print(ans) print ans w = 0 0 w ans = min(ans, max(w, r)) min(ans, max(w, r)) ans N = int(input()) int(input()) N ans = min(N, r) min(N, r) ans s = input() input() s r = s.count('R') s.count('R') r r -= 1 1 r w += 1 1 w
N = int(input())
s = input()

w = 0
r = s.count('R')
ans = min(N, r)

for i in range(N):
    if s[i] == 'R':
        r -= 1
    else:
        w += 1
    ans = min(ans, max(w, r))

print(ans)