S = input()

if S == 'RSS':
    print(1)
    exit()

tmp = 0
for i in range(len(S)):
    if S[i] == 'R':
        tmp += 1
    else:
        if i == 2:
            break
        else:
            tmp = 0
print(tmp)             S = input() S input() input if S == 'RSS':
    print(1)
    exit() S == 'RSS' S 'RSS' print(1) print 1 exit() exit tmp = 0 tmp 0 for i in range(len(S)):
    if S[i] == 'R':
        tmp += 1
    else:
        if i == 2:
            break
        else:
            tmp = 0 i range(len(S)) range len(S) len S if S[i] == 'R':
        tmp += 1
    else:
        if i == 2:
            break
        else:
            tmp = 0 S[i] == 'R' S[i] S i 'R' tmp += 1 tmp 1 if i == 2:
            break
        else:
            tmp = 0 i == 2 i 2 break tmp = 0 tmp 0 print(tmp) print tmp tmp = 0 0 tmp S = input() input() S tmp += 1 1 tmp tmp = 0 0 tmp
S = input()

if S == 'RSS':
    print(1)
    exit()

tmp = 0
for i in range(len(S)):
    if S[i] == 'R':
        tmp += 1
    else:
        if i == 2:
            break
        else:
            tmp = 0
print(tmp)            
