var a,s: integer;
begin
readln(a);
a:=abs(a);
s:=(a div 100)+(a div 10 mod 10) + (a mod 10);
writeln(s);
end.
var a,s: integer;
begin
readln(a);
a:=abs(a);
s:=(a div 100)+(a div 10 mod 10) + (a mod 10);
writeln(s);
end.