import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1)

if __name__=='__main__':
    main() import sys sys def input(): return sys.stdin.readline().rstrip() input def main():
    S = input()
    if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1) main S = input() S input() input if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1) S == "RRR" S "RRR" print(3) print 3 elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
     ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R' (S[0] != 'R') ^ (S[2] != 'R') S[0] != 'R' S[0] S 0 'R' S[2] != 'R' S[2] S 2 'R' S[1]=='R' S[1] S 1 'R' print(2) print 2 elif S == "SSS":
        print(0)
     S == "SSS" S "SSS" print(0) print 0 print(1) print 1 if __name__=='__main__':
    main() __name__=='__main__' __name__ '__main__' main() main def input(): return sys.stdin.readline().rstrip() def input(): return sys.stdin.readline().rstrip() input def main():
    S = input()
    if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1) def main():
    S = input()
    if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1) main
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    S = input()
    if S == "RRR":
        print(3)
    elif ((S[0] != 'R') ^ (S[2] != 'R')) and S[1]=='R':
        print(2)
    elif S == "SSS":
        print(0)
    else:
        print(1)

if __name__=='__main__':
    main()