s = input()
w = {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1}
print(w[s]) s = input() s input() input w = {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1} w {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1} "SSS" "SSS" 0 "SSR" "SSR" 1 "SRS" "SRS" 1 "SRR" "SRR" 2 "RRR" "RRR" 3 "RSR" "RSR" 1 "RRS" "RRS" 2 "RSS" "RSS" 1 print(w[s]) print w[s] w s w = {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1} {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1} w s = input() input() s
s = input()
w = {"SSS":0,"SSR":1,"SRS":1,"SRR":2,"RRR":3,"RSR":1,"RRS":2,"RSS":1}
print(w[s])