n = int(input())
s = input().rstrip()

i=0
j=n-1
c= 0

while i!=j:
  while s[j]!='R' and j>i:
    j-=1
    
  while s[i]=='R' and j>i:
    i+=1
 
  if i!=j:
    c+= 1
    i+= 1
    j-=1
  if i>=j:
    break
    
print(c) n = int(input()) n int(input()) int input() input s = input().rstrip() s input().rstrip() ().rstrip () input rstrip i=0 i 0 j=n-1 j n-1 n 1 c= 0 c 0 while i!=j:
  while s[j]!='R' and j>i:
    j-=1
    
  while s[i]=='R' and j>i:
    i+=1
 
  if i!=j:
    c+= 1
    i+= 1
    j-=1
  if i>=j:
    break
     i!=j i j while s[j]!='R' and j>i:
    j-=1
    
   s[j]!='R' and j>i s[j]!='R' s[j] s j 'R' j>i j i j-=1 j 1 while s[i]=='R' and j>i:
    i+=1
 
   s[i]=='R' and j>i s[i]=='R' s[i] s i 'R' j>i j i i+=1 i 1 if i!=j:
    c+= 1
    i+= 1
    j-=1
   i!=j i j c+= 1 c 1 i+= 1 i 1 j-=1 j 1 if i>=j:
    break
     i>=j i j break print(c) print c n = int(input()) int(input()) n c= 0 0 c j-=1 1 j i+= 1 1 i s = input().rstrip() input().rstrip() s i=0 0 i j-=1 1 j i+=1 1 i j=n-1 n-1 j c+= 1 1 c
n = int(input())
s = input().rstrip()

i=0
j=n-1
c= 0

while i!=j:
  while s[j]!='R' and j>i:
    j-=1
    
  while s[i]=='R' and j>i:
    i+=1
 
  if i!=j:
    c+= 1
    i+= 1
    j-=1
  if i>=j:
    break
    
print(c)