N=int(input())
stones = list(input())
l = 0
r = N-1
count = 0

while(True):
  while(stones[l] == "R" and l < N-1):
    l += 1
  while(stones[r] == "W" and r > 0):
    r -= 1
  if (l >= r):
    print(count)
    exit()
  else:
    count += 1
    l += 1
    r -= 1 N=int(input()) N int(input()) int input() input stones = list(input()) stones list(input()) list input() input l = 0 l 0 r = N-1 r N-1 N 1 count = 0 count 0 while(True):
  while(stones[l] == "R" and l < N-1):
    l += 1
  while(stones[r] == "W" and r > 0):
    r -= 1
  if (l >= r):
    print(count)
    exit()
  else:
    count += 1
    l += 1
    r -= 1 True while(stones[l] == "R" and l < N-1):
    l += 1
   stones[l] == "R" and l < N-1 stones[l] == "R" stones[l] stones l "R" l < N-1 l N-1 N 1 l += 1 l 1 while(stones[r] == "W" and r > 0):
    r -= 1
   stones[r] == "W" and r > 0 stones[r] == "W" stones[r] stones r "W" r > 0 r 0 r -= 1 r 1 if (l >= r):
    print(count)
    exit()
  else:
    count += 1
    l += 1
    r -= 1 l >= r l r print(count) print count exit() exit count += 1 count 1 l += 1 l 1 r -= 1 r 1 r -= 1 1 r l += 1 1 l stones = list(input()) list(input()) stones N=int(input()) int(input()) N r = N-1 N-1 r l += 1 1 l r -= 1 1 r l = 0 0 l count = 0 0 count count += 1 1 count
N=int(input())
stones = list(input())
l = 0
r = N-1
count = 0

while(True):
  while(stones[l] == "R" and l < N-1):
    l += 1
  while(stones[r] == "W" and r > 0):
    r -= 1
  if (l >= r):
    print(count)
    exit()
  else:
    count += 1
    l += 1
    r -= 1