var m,s: integer;
begin
readln(m);
s:=0;
while m>0 do
s:=s+m mod 10;
m:=m div 10;
end;
writeln(s);
end.
var m,s: integer;
begin
readln(m);
s:=0;
while m>0 do
begin
s:=s+m mod 10;
m:=m div 10;
end;
writeln(s);
end.