import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    r = input()
    if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
    return 0

if __name__ == "__main__":
    solve() import math math import collections collections import fractions fractions import itertools itertools import functools functools import operator operator import bisect bisect def solve():
    r = input()
    if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
    return 0 solve r = input() r input() input if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
     r == 'RRR' r 'RRR' print(3) print 3 elif r == 'RRS' or r == 'SRR':
        print(2)
     r == 'RRS' or r == 'SRR' r == 'RRS' r 'RRS' r == 'SRR' r 'SRR' print(2) print 2 elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
     r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS' r == 'RSR' or r == 'RSS' or r =='SSR' r == 'RSR' or r == 'RSS' r == 'RSR' r 'RSR' r == 'RSS' r 'RSS' r =='SSR' r 'SSR' r =='SRS' r 'SRS' print(1) print 1 elif r == 'SSS':
        print(0)
     r == 'SSS' r 'SSS' print(0) print 0 return 0 0 if __name__ == "__main__":
    solve() __name__ == "__main__" __name__ "__main__" solve() solve def solve():
    r = input()
    if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
    return 0 def solve():
    r = input()
    if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
    return 0 solve
import math
import collections
import fractions
import itertools
import functools
import operator
import bisect

def solve():
    r = input()
    if r == 'RRR':
        print(3)
    elif r == 'RRS' or r == 'SRR':
        print(2)
    elif r == 'RSR' or r == 'RSS' or r =='SSR' or r =='SRS':
        print(1)
    elif r == 'SSS':
        print(0)
    return 0

if __name__ == "__main__":
    solve()