import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

days = readString()
if 'RRR' in days:
  print(3)
elif 'RR' in days:
  print(2)
elif 'R' in days:
  print(1)
else:
  print(0)

# readStringList()
# count = 0
# res = 0
# for c in days:
#     count += 0 if c == 'S' else 1
#     res = max(res,count)
# print(res) import sys sys sys.setrecursionlimit(10**7) sys.setrecursionlimit sys setrecursionlimit 10**7 10 7 def input(): return sys.stdin.readline()[:-1] input mod = 10**9 + 7 mod 10**9 + 7 10**9 10 9 7 def readInt():return int(input()) readInt def readIntList():return list(map(int,input().split())) readIntList def readStringList():return list(input()) readStringList def readStringListWithSpace():return list(input().split()) readStringListWithSpace def readString():return input() readString days = readString() days readString() readString if 'RRR' in days:
  print(3)
elif 'RR' in days:
  print(2)
elif 'R' in days:
  print(1)
else:
  print(0)

# readStringList()
# count = 0
# res = 0
# for c in days:
#     count += 0 if c == 'S' else 1
#     res = max(res,count)
# print(res) 'RRR' in days 'RRR' days print(3) print 3 elif 'RR' in days:
  print(2) 'RR' in days 'RR' days print(2) print 2 elif 'R' in days:
  print(1) 'R' in days 'R' days print(1) print 1 print(0) print 0 def readStringListWithSpace():return list(input().split()) def readStringListWithSpace():return list(input().split()) readStringListWithSpace def readStringList():return list(input()) def readStringList():return list(input()) readStringList mod = 10**9 + 7 10**9 + 7 mod def readInt():return int(input()) def readInt():return int(input()) readInt days = readString() readString() days def readString():return input() def readString():return input() readString def input(): return sys.stdin.readline()[:-1] def input(): return sys.stdin.readline()[:-1] input def readIntList():return list(map(int,input().split())) def readIntList():return list(map(int,input().split())) readIntList
import sys
sys.setrecursionlimit(10**7)

def input(): return sys.stdin.readline()[:-1]
mod = 10**9 + 7
def readInt():return int(input())
def readIntList():return list(map(int,input().split()))
def readStringList():return list(input())
def readStringListWithSpace():return list(input().split())
def readString():return input()

days = readString()
if 'RRR' in days:
  print(3)
elif 'RR' in days:
  print(2)
elif 'R' in days:
  print(1)
else:
  print(0)

# readStringList()
# count = 0
# res = 0
# for c in days:
#     count += 0 if c == 'S' else 1
#     res = max(res,count)
# print(res)