if __name__ == "__main__":
    S = input()
    list_s = [s for s in S]
    ans = 0
    if list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 0
    elif list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 3
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 1

    print(ans)



 if __name__ == "__main__":
    S = input()
    list_s = [s for s in S]
    ans = 0
    if list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 0
    elif list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 3
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 1

    print(ans) __name__ == "__main__" __name__ "__main__" S = input() S input() input s for s in S for s in S s S for s in S s list_s = [s for s in S] list_s [s for s in S] ans = 0 ans 0 if list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 0
    elif list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 3
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 1

     list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'S' list_s[0] == 'S' and list_s[1] == 'S' list_s[0] == 'S' list_s[0] list_s 0 'S' list_s[1] == 'S' list_s[1] list_s 1 'S' list_s[2] == 'S' list_s[2] list_s 2 'S' ans = 0 ans 0 elif list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
     list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R' list_s[0] == 'S' and list_s[1] == 'S' list_s[0] == 'S' list_s[0] list_s 0 'S' list_s[1] == 'S' list_s[1] list_s 1 'S' list_s[2] == 'R' list_s[2] list_s 2 'R' ans = 1 ans 1 elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 2
     list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R' list_s[0] == 'S' and list_s[1] == 'R' list_s[0] == 'S' list_s[0] list_s 0 'S' list_s[1] == 'R' list_s[1] list_s 1 'R' list_s[2] == 'R' list_s[2] list_s 2 'R' ans = 2 ans 2 elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 3
     list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R' list_s[0] == 'R' and list_s[1] == 'R' list_s[0] == 'R' list_s[0] list_s 0 'R' list_s[1] == 'R' list_s[1] list_s 1 'R' list_s[2] == 'R' list_s[2] list_s 2 'R' ans = 3 ans 3 elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
     list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R' list_s[0] == 'R' and list_s[1] == 'S' list_s[0] == 'R' list_s[0] list_s 0 'R' list_s[1] == 'S' list_s[1] list_s 1 'S' list_s[2] == 'R' list_s[2] list_s 2 'R' ans = 1 ans 1 elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 2
     list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S' list_s[0] == 'R' and list_s[1] == 'R' list_s[0] == 'R' list_s[0] list_s 0 'R' list_s[1] == 'R' list_s[1] list_s 1 'R' list_s[2] == 'S' list_s[2] list_s 2 'S' ans = 2 ans 2 elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 1
     list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S' list_s[0] == 'R' and list_s[1] == 'S' list_s[0] == 'R' list_s[0] list_s 0 'R' list_s[1] == 'S' list_s[1] list_s 1 'S' list_s[2] == 'S' list_s[2] list_s 2 'S' ans = 1 ans 1 elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 1

     list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S' list_s[0] == 'S' and list_s[1] == 'R' list_s[0] == 'S' list_s[0] list_s 0 'S' list_s[1] == 'R' list_s[1] list_s 1 'R' list_s[2] == 'S' list_s[2] list_s 2 'S' ans = 1 ans 1 print(ans) print ans ans = 0 0 ans ans = 2 2 ans ans = 1 1 ans list_s = [s for s in S] [s for s in S] list_s ans = 3 3 ans ans = 0 0 ans ans = 1 1 ans ans = 2 2 ans S = input() input() S ans = 1 1 ans ans = 1 1 ans
if __name__ == "__main__":
    S = input()
    list_s = [s for s in S]
    ans = 0
    if list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 0
    elif list_s[0] == 'S' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'R':
        ans = 3
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'R':
        ans = 1
    elif list_s[0] == 'R' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 2
    elif list_s[0] == 'R' and list_s[1] == 'S' and list_s[2] == 'S':
        ans = 1
    elif list_s[0] == 'S' and list_s[1] == 'R' and list_s[2] == 'S':
        ans = 1

    print(ans)




