def rainyseason(S):
    days = 0
    max_days = 0
    flag = 0
    for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
    if days > max_days:
        max_days = days
    return max_days

if __name__ == '__main__':
    S =str(input())
    print(rainyseason(S)) def rainyseason(S):
    days = 0
    max_days = 0
    flag = 0
    for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
    if days > max_days:
        max_days = days
    return max_days rainyseason days = 0 days 0 max_days = 0 max_days 0 flag = 0 flag 0 for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
     i range(len(S)) range len(S) len S if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
     S[i] == 'R' S[i] S i 'R' days += 1 days 1 flag = 1 flag 1 elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
     S[i] == 'S' and flag == 1 S[i] == 'S' S[i] S i 'S' flag == 1 flag 1 if days > max_days:
                max_days = days
                days = 0
                flag = 0
     days > max_days days max_days max_days = days max_days days days = 0 days 0 flag = 0 flag 0 if days > max_days:
        max_days = days
     days > max_days days max_days max_days = days max_days days return max_days max_days S S if __name__ == '__main__':
    S =str(input())
    print(rainyseason(S)) __name__ == '__main__' __name__ '__main__' S =str(input()) S str(input()) str input() input print(rainyseason(S)) print rainyseason(S) rainyseason S S =str(input()) str(input()) S def rainyseason(S):
    days = 0
    max_days = 0
    flag = 0
    for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
    if days > max_days:
        max_days = days
    return max_days def rainyseason(S):
    days = 0
    max_days = 0
    flag = 0
    for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
    if days > max_days:
        max_days = days
    return max_days rainyseason
def rainyseason(S):
    days = 0
    max_days = 0
    flag = 0
    for i in range(len(S)):
        if S[i] == 'R':
            days += 1
            flag = 1
        elif S[i] == 'S' and flag == 1:
            if days > max_days:
                max_days = days
                days = 0
                flag = 0
    if days > max_days:
        max_days = days
    return max_days

if __name__ == '__main__':
    S =str(input())
    print(rainyseason(S))