n=int(input())
s=input()
a=[0,s.count('R')]
ans=max(a)
for i in range(n):
  if s[i]=='R':
    a[1]-=1
  else:
    a[0]+=1
  ans=min(ans,max(a))
print(ans) n=int(input()) n int(input()) int input() input s=input() s input() input a=[0,s.count('R')] a [0,s.count('R')] 0 s.count('R') s.count s count 'R' ans=max(a) ans max(a) max a for i in range(n):
  if s[i]=='R':
    a[1]-=1
  else:
    a[0]+=1
  ans=min(ans,max(a)) i range(n) range n if s[i]=='R':
    a[1]-=1
  else:
    a[0]+=1
   s[i]=='R' s[i] s i 'R' a[1]-=1 a[1] a 1 1 a[0]+=1 a[0] a 0 1 ans=min(ans,max(a)) ans min(ans,max(a)) min ans max(a) max a print(ans) print ans a=[0,s.count('R')] [0,s.count('R')] a n=int(input()) int(input()) n s=input() input() s ans=max(a) max(a) ans ans=min(ans,max(a)) min(ans,max(a)) ans
n=int(input())
s=input()
a=[0,s.count('R')]
ans=max(a)
for i in range(n):
  if s[i]=='R':
    a[1]-=1
  else:
    a[0]+=1
  ans=min(ans,max(a))
print(ans)