#a問題(できなかった)
s = input()
p=s[0]=='R'
q=s[1]=='R'
r=s[2]=='R'

if p and q and r==True:
    print(3)
elif (p and q)or(q and r)==True:
    print(2)
elif p or q or r ==True:
    print(1)
else:
    print(0)

 s = input() s input() input p=s[0]=='R' p s[0]=='R' s[0] s 0 'R' q=s[1]=='R' q s[1]=='R' s[1] s 1 'R' r=s[2]=='R' r s[2]=='R' s[2] s 2 'R' if p and q and r==True:
    print(3)
elif (p and q)or(q and r)==True:
    print(2)
elif p or q or r ==True:
    print(1)
else:
    print(0) p and q and r==True p and q p q r==True r True print(3) print 3 elif (p and q)or(q and r)==True:
    print(2) (p and q)or(q and r)==True p and q p q (q and r)==True q and r q r True print(2) print 2 elif p or q or r ==True:
    print(1) p or q or r ==True p or q p q r ==True r True print(1) print 1 print(0) print 0 q=s[1]=='R' s[1]=='R' q s = input() input() s p=s[0]=='R' s[0]=='R' p r=s[2]=='R' s[2]=='R' r
#a問題(できなかった)
s = input()
p=s[0]=='R'
q=s[1]=='R'
r=s[2]=='R'

if p and q and r==True:
    print(3)
elif (p and q)or(q and r)==True:
    print(2)
elif p or q or r ==True:
    print(1)
else:
    print(0)


