'''
def main():
    S = input()
    cnt = 0
    ans = 0
    f = 1
    for i in range(3):
        if S[i] == 'R':
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)
'''
def main():
    S = input()
    p = S[0] == 'R'
    q = S[1] == 'R'
    r = S[2] == 'R'

    if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
    


if __name__ == "__main__":
    main() '''
def main():
    S = input()
    cnt = 0
    ans = 0
    f = 1
    for i in range(3):
        if S[i] == 'R':
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)
''' def main():
    S = input()
    p = S[0] == 'R'
    q = S[1] == 'R'
    r = S[2] == 'R'

    if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
     main S = input() S input() input p = S[0] == 'R' p S[0] == 'R' S[0] S 0 'R' q = S[1] == 'R' q S[1] == 'R' S[1] S 1 'R' r = S[2] == 'R' r S[2] == 'R' S[2] S 2 'R' if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
     p and q and r p and q p q r print(3) print 3 elif (p and q) or (q and r):
        print(2)
     (p and q) or (q and r) p and q p q q and r q r print(2) print 2 elif p or q or r:
        print(1)
     p or q or r p or q p q r print(1) print 1 print(0) print 0 if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    S = input()
    p = S[0] == 'R'
    q = S[1] == 'R'
    r = S[2] == 'R'

    if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
     def main():
    S = input()
    p = S[0] == 'R'
    q = S[1] == 'R'
    r = S[2] == 'R'

    if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
     main
'''
def main():
    S = input()
    cnt = 0
    ans = 0
    f = 1
    for i in range(3):
        if S[i] == 'R':
            cnt += 1
        else:
            cnt = 0
        ans = max(ans, cnt)
    print(ans)
'''
def main():
    S = input()
    p = S[0] == 'R'
    q = S[1] == 'R'
    r = S[2] == 'R'

    if p and q and r :
        print(3)
    elif (p and q) or (q and r):
        print(2)
    elif p or q or r:
        print(1)
    else:
        print(0)
    


if __name__ == "__main__":
    main()