Var S, N: integer;
Begin
ReadLn(N);
S := 0;
while n > 10 do
begin
S := S + N mod 10;
N := N div 10;
end;
WriteLn(S)
End.
Var S, N: integer;
Begin
ReadLn(N);
S := 0;
while n > 10 do
begin
S := S + N mod 10;
N := N div 10;
end;
WriteLn(S)
End.