S = input()
 
 
D = S.count("R")
 
if D == 1:
    print(1)
 
elif D == 3:
    print(3)
 
elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
 
elif D == 0:
    print(0)     S = input() S input() input D = S.count("R") D S.count("R") S.count S count "R" if D == 1:
    print(1)
 
elif D == 3:
    print(3)
 
elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
 
elif D == 0:
    print(0)     D == 1 D 1 print(1) print 1 elif D == 3:
    print(3)
  D == 3 D 3 print(3) print 3 elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
  D == 2 D 2 for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
  i range(3) range 3 if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
  S[i] =="R" S[i] S i "R" if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
  S[i+1] =="R" S[i+1] S i+1 i 1 "R" print(2) print 2 break print(1) print 1 break elif D == 0:
    print(0)     D == 0 D 0 print(0) print 0 D = S.count("R") S.count("R") D S = input() input() S
S = input()
 
 
D = S.count("R")
 
if D == 1:
    print(1)
 
elif D == 3:
    print(3)
 
elif D == 2:
    for i in range(3):
        if S[i] =="R":
            if S[i+1] =="R":
                print(2)
                break
 
            else:
                print(1)
                break
 
elif D == 0:
    print(0)    
