s = input()

if "RRR" in s:
    print(3)
    exit()
if "RR" in s:
    print(2)
    exit()
if "R" in s:
    print(1)
    exit()
if "R" not in s:
    print(0)
    exit() s = input() s input() input if "RRR" in s:
    print(3)
    exit() "RRR" in s "RRR" s print(3) print 3 exit() exit if "RR" in s:
    print(2)
    exit() "RR" in s "RR" s print(2) print 2 exit() exit if "R" in s:
    print(1)
    exit() "R" in s "R" s print(1) print 1 exit() exit if "R" not in s:
    print(0)
    exit() "R" not in s "R" s print(0) print 0 exit() exit s = input() input() s
s = input()

if "RRR" in s:
    print(3)
    exit()
if "RR" in s:
    print(2)
    exit()
if "R" in s:
    print(1)
    exit()
if "R" not in s:
    print(0)
    exit()
