-module('Main').
-export([main/1]).

main(_) ->
    {ok, [S]} = io:fread("", "~s"),
    RStrings = string:split(S, "S"),
    RStringLengthes = lists:map(fun(X) ->
                                        string:length(X)
                                end,
                                RStrings),
    Ans = lists:max(RStringLengthes),
    io:format("~p~n", [Ans]),
    halt().