# 初期入力
from bisect import bisect_left
import sys
#input = sys.stdin.readline  #文字列では使わない
N = int(input())
c =input().strip()
ans =0
w =[i for i, x in enumerate(c) if x == 'W']
r =[i for i, x in enumerate(c) if x == 'R']
w_num =len(w) #全体でWの数
r_num =len(r) #全体でRの数

ans =bisect_left(r,r_num)
print(r_num -ans) from bisect import bisect_left import sys sys N = int(input()) N int(input()) int input() input c =input().strip() c input().strip() ().strip () input strip ans =0 ans 0 i for i, x in enumerate(c) if x == 'W' for i, x in enumerate(c) if x == 'W' i x enumerate(c) enumerate c x == 'W' x 'W' if x == 'W' i w =[i for i, x in enumerate(c) if x == 'W'] w [i for i, x in enumerate(c) if x == 'W'] i for i, x in enumerate(c) if x == 'R' for i, x in enumerate(c) if x == 'R' i x enumerate(c) enumerate c x == 'R' x 'R' if x == 'R' i r =[i for i, x in enumerate(c) if x == 'R'] r [i for i, x in enumerate(c) if x == 'R'] w_num =len(w) w_num len(w) len w r_num =len(r) r_num len(r) len r ans =bisect_left(r,r_num) ans bisect_left(r,r_num) bisect_left r r_num print(r_num -ans) print r_num -ans r_num ans w =[i for i, x in enumerate(c) if x == 'W'] [i for i, x in enumerate(c) if x == 'W'] w ans =0 0 ans r =[i for i, x in enumerate(c) if x == 'R'] [i for i, x in enumerate(c) if x == 'R'] r r_num =len(r) len(r) r_num w_num =len(w) len(w) w_num N = int(input()) int(input()) N ans =bisect_left(r,r_num) bisect_left(r,r_num) ans c =input().strip() input().strip() c
# 初期入力
from bisect import bisect_left
import sys
#input = sys.stdin.readline  #文字列では使わない
N = int(input())
c =input().strip()
ans =0
w =[i for i, x in enumerate(c) if x == 'W']
r =[i for i, x in enumerate(c) if x == 'R']
w_num =len(w) #全体でWの数
r_num =len(r) #全体でRの数

ans =bisect_left(r,r_num)
print(r_num -ans)