a=input()

cnt=0

for i in a:
  if i=='R':
    cnt+=1

if cnt==2 and len(a)==3:
  if a[0]=='R' and a[2]=='R':
    cnt=1

print(cnt) a=input() a input() input cnt=0 cnt 0 for i in a:
  if i=='R':
    cnt+=1 i a if i=='R':
    cnt+=1 i=='R' i 'R' cnt+=1 cnt 1 if cnt==2 and len(a)==3:
  if a[0]=='R' and a[2]=='R':
    cnt=1 cnt==2 and len(a)==3 cnt==2 cnt 2 len(a)==3 len(a) len a 3 if a[0]=='R' and a[2]=='R':
    cnt=1 a[0]=='R' and a[2]=='R' a[0]=='R' a[0] a 0 'R' a[2]=='R' a[2] a 2 'R' cnt=1 cnt 1 print(cnt) print cnt cnt=0 0 cnt a=input() input() a cnt=1 1 cnt cnt+=1 1 cnt
a=input()

cnt=0

for i in a:
  if i=='R':
    cnt+=1

if cnt==2 and len(a)==3:
  if a[0]=='R' and a[2]=='R':
    cnt=1

print(cnt)
