s = input()

if "RRR" in s:
    print(3)
elif "RR" in s and "S" in s:
    print(2)
elif s.count("R") == 1 or "RSR" in s:
    print(1)
elif s.count("R") == 0:
    print(0) s = input() s input() input if "RRR" in s:
    print(3)
elif "RR" in s and "S" in s:
    print(2)
elif s.count("R") == 1 or "RSR" in s:
    print(1)
elif s.count("R") == 0:
    print(0) "RRR" in s "RRR" s print(3) print 3 elif "RR" in s and "S" in s:
    print(2) "RR" in s and "S" in s "RR" in s "RR" s "S" in s "S" s print(2) print 2 elif s.count("R") == 1 or "RSR" in s:
    print(1) s.count("R") == 1 or "RSR" in s s.count("R") == 1 s.count("R") s.count s count "R" 1 "RSR" in s "RSR" s print(1) print 1 elif s.count("R") == 0:
    print(0) s.count("R") == 0 s.count("R") s.count s count "R" 0 print(0) print 0 s = input() input() s
s = input()

if "RRR" in s:
    print(3)
elif "RR" in s and "S" in s:
    print(2)
elif s.count("R") == 1 or "RSR" in s:
    print(1)
elif s.count("R") == 0:
    print(0)