S = str(input())
count = 0
if S == "RSR":
    print(1)
else:
    for i in range(0, 3):
        if S[i] == "R":
            count += 1
    print(count) S = str(input()) S str(input()) str input() input count = 0 count 0 if S == "RSR":
    print(1)
else:
    for i in range(0, 3):
        if S[i] == "R":
            count += 1
    print(count) S == "RSR" S "RSR" print(1) print 1 for i in range(0, 3):
        if S[i] == "R":
            count += 1
     i range(0, 3) range 0 3 if S[i] == "R":
            count += 1
     S[i] == "R" S[i] S i "R" count += 1 count 1 print(count) print count count += 1 1 count S = str(input()) str(input()) S count = 0 0 count
S = str(input())
count = 0
if S == "RSR":
    print(1)
else:
    for i in range(0, 3):
        if S[i] == "R":
            count += 1
    print(count)