S = input()[0:3]

i=S.count('RRR')
j=S.count('RR')
k=S.count('R')
l=S.count('RSR')

print(max(i,j,k-l)) S = input()[0:3] S input()[0:3] () input 0:3 0 3 i=S.count('RRR') i S.count('RRR') S.count S count 'RRR' j=S.count('RR') j S.count('RR') S.count S count 'RR' k=S.count('R') k S.count('R') S.count S count 'R' l=S.count('RSR') l S.count('RSR') S.count S count 'RSR' print(max(i,j,k-l)) print max(i,j,k-l) max i j k-l k l S = input()[0:3] input()[0:3] S k=S.count('R') S.count('R') k i=S.count('RRR') S.count('RRR') i l=S.count('RSR') S.count('RSR') l j=S.count('RR') S.count('RR') j
S = input()[0:3]

i=S.count('RRR')
j=S.count('RR')
k=S.count('R')
l=S.count('RSR')

print(max(i,j,k-l))