var A,S:integer;
begin
Readln(A);
repeat
S:=S+A mod 10;
A:=A div 10;
until A=0;
Writeln(S);
end.