n = int(input())
string = input()

left = string[:0]
right = string[0:]
w, r = left.count("W"), right.count("R")
count = max(w,r)

for i in range(1,n+1):
    next_str = string[i-1]
    if next_str == "W":
        w +=1
    else:
        r -= 1
    tmp = max(w,r)
    if tmp < count:
        count = tmp
        
print(count) n = int(input()) n int(input()) int input() input string = input() string input() input left = string[:0] left string[:0] string :0 0 right = string[0:] right string[0:] string 0: 0 w, r = left.count("W"), right.count("R") w left.count("W") left.count left count "W" r right.count("R") right.count right count "R" count = max(w,r) count max(w,r) max w r for i in range(1,n+1):
    next_str = string[i-1]
    if next_str == "W":
        w +=1
    else:
        r -= 1
    tmp = max(w,r)
    if tmp < count:
        count = tmp
         i range(1,n+1) range 1 n+1 n 1 next_str = string[i-1] next_str string[i-1] string i-1 i 1 if next_str == "W":
        w +=1
    else:
        r -= 1
     next_str == "W" next_str "W" w +=1 w 1 r -= 1 r 1 tmp = max(w,r) tmp max(w,r) max w r if tmp < count:
        count = tmp
         tmp < count tmp count count = tmp count tmp print(count) print count left = string[:0] string[:0] left next_str = string[i-1] string[i-1] next_str w +=1 1 w n = int(input()) int(input()) n count = tmp tmp count string = input() input() string r -= 1 1 r right = string[0:] string[0:] right w, r = left.count("W"), right.count("R") left.count("W") w tmp = max(w,r) max(w,r) tmp count = max(w,r) max(w,r) count r = left.count("W"), right.count("R") right.count("R") r
n = int(input())
string = input()

left = string[:0]
right = string[0:]
w, r = left.count("W"), right.count("R")
count = max(w,r)

for i in range(1,n+1):
    next_str = string[i-1]
    if next_str == "W":
        w +=1
    else:
        r -= 1
    tmp = max(w,r)
    if tmp < count:
        count = tmp
        
print(count)