s=input()
flag=False
ans=0
for i in range(3):
    if s[i]=="R":
        ans+=1
        if not flag:
            flag=True
    if s[i]=="S" and flag:
        break
print(ans) s=input() s input() input flag=False flag False ans=0 ans 0 for i in range(3):
    if s[i]=="R":
        ans+=1
        if not flag:
            flag=True
    if s[i]=="S" and flag:
        break i range(3) range 3 if s[i]=="R":
        ans+=1
        if not flag:
            flag=True
     s[i]=="R" s[i] s i "R" ans+=1 ans 1 if not flag:
            flag=True
     not flag flag flag=True flag True if s[i]=="S" and flag:
        break s[i]=="S" and flag s[i]=="S" s[i] s i "S" flag break print(ans) print ans ans+=1 1 ans flag=True True flag ans=0 0 ans flag=False False flag s=input() input() s
s=input()
flag=False
ans=0
for i in range(3):
    if s[i]=="R":
        ans+=1
        if not flag:
            flag=True
    if s[i]=="S" and flag:
        break
print(ans)