n = int(input())

s = list(input())

count_red = s.count('R')
count_white = 0

A = []
for i in range(n):
    if s[i] == 'R':
        count_red -= 1
    if s[i] == 'W':
        count_white += 1
    A.append(max(count_red, count_white))

if len(set(s)) == 1 and list(set(s)) == ['W']:
    print(0)
else:
    print(min(A)) n = int(input()) n int(input()) int input() input s = list(input()) s list(input()) list input() input count_red = s.count('R') count_red s.count('R') s.count s count 'R' count_white = 0 count_white 0 A = [] A [] for i in range(n):
    if s[i] == 'R':
        count_red -= 1
    if s[i] == 'W':
        count_white += 1
    A.append(max(count_red, count_white)) i range(n) range n if s[i] == 'R':
        count_red -= 1
     s[i] == 'R' s[i] s i 'R' count_red -= 1 count_red 1 if s[i] == 'W':
        count_white += 1
     s[i] == 'W' s[i] s i 'W' count_white += 1 count_white 1 A.append(max(count_red, count_white)) A.append A append max(count_red, count_white) max count_red count_white if len(set(s)) == 1 and list(set(s)) == ['W']:
    print(0)
else:
    print(min(A)) len(set(s)) == 1 and list(set(s)) == ['W'] len(set(s)) == 1 len(set(s)) len set(s) set s 1 list(set(s)) == ['W'] list(set(s)) list set(s) set s ['W'] 'W' print(0) print 0 print(min(A)) print min(A) min A count_red -= 1 1 count_red n = int(input()) int(input()) n s = list(input()) list(input()) s count_white += 1 1 count_white count_white = 0 0 count_white A = [] [] A count_red = s.count('R') s.count('R') count_red
n = int(input())

s = list(input())

count_red = s.count('R')
count_white = 0

A = []
for i in range(n):
    if s[i] == 'R':
        count_red -= 1
    if s[i] == 'W':
        count_white += 1
    A.append(max(count_red, count_white))

if len(set(s)) == 1 and list(set(s)) == ['W']:
    print(0)
else:
    print(min(A))