S=input()
ans=0
if 'R' in S:
    ans+=1
for i in range(2):
    if S[i]==S[i+1]=='R':
        ans+=1
print(ans) S=input() S input() input ans=0 ans 0 if 'R' in S:
    ans+=1 'R' in S 'R' S ans+=1 ans 1 for i in range(2):
    if S[i]==S[i+1]=='R':
        ans+=1 i range(2) range 2 if S[i]==S[i+1]=='R':
        ans+=1 S[i]==S[i+1]=='R' S[i]==S[i+1] S[i] S i S[i+1] S i+1 i 1 'R' ans+=1 ans 1 print(ans) print ans ans=0 0 ans ans+=1 1 ans S=input() input() S ans+=1 1 ans
S=input()
ans=0
if 'R' in S:
    ans+=1
for i in range(2):
    if S[i]==S[i+1]=='R':
        ans+=1
print(ans)