def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n)


if __name__ == '__main__':
    print(check_weather(input())) def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n) check_weather count = 0 count 0 l_n = [0] l_n [0] 0 for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
     index i enumerate(weathers) enumerate weathers if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

         weathers[-1] == 'R' and index == len(weathers) - 1 weathers[-1] == 'R' weathers[-1] weathers -1 'R' index == len(weathers) - 1 index len(weathers) - 1 len(weathers) len weathers 1 count += 1 count 1 l_n.append(count) l_n.append l_n append count break if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
     i == 'R' i 'R' count += 1 count 1 if max(l_n) <= count:
                l_n.append(count)
             max(l_n) <= count max(l_n) max l_n count l_n.append(count) l_n.append l_n append count count = 0 count 0 return max(l_n) max(l_n) max l_n weathers: str weathers if __name__ == '__main__':
    print(check_weather(input())) __name__ == '__main__' __name__ '__main__' print(check_weather(input())) print check_weather(input()) check_weather input() input def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n) def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n) check_weather
def check_weather(weathers: str) -> int:
    count = 0
    l_n = [0]
    for index, i in enumerate(weathers):
        if weathers[-1] == 'R' and index == len(weathers) - 1:
            count += 1
            l_n.append(count)
            break

        if i == 'R':
            count += 1
        else:
            if max(l_n) <= count:
                l_n.append(count)
            count = 0
    return max(l_n)


if __name__ == '__main__':
    print(check_weather(input()))