program qq;
var
i,b: integer;
begin
read(i);
b:= (i div 100) + (i div 10 mod 10) + (i mod 10);
write(b);
end.
program qq;
var
i,b: integer;
begin
read(i);
b:= (i div 100) + (i div 10 mod 10) + (i mod 10);
write(b);
end.