var s: string; n: word; c: char;
begin
readln(s);
c := s[Length(s)];
n := 0;
while c <> ' ' and n < Length(s) do begin
inc(n);
c := s[Length(s) - n];
end;
if n = Length(s) writeln('Wrong string')
else writeln('Length of last word - ', n);
readln;
end.