1.
var
n: integer;
begin
read(n);
write(n div 100 + n div 10 mod 10 + n mod 10)
end.
2.
var
d: real;
n: integer;
begin
read(d);
n := round(d * 100);
write(abs(n div 1000 + n div 100 mod 10 - n div 10 mod 10 - n mod 10));
end.
3.
var
d: real;
n: integer;
begin
read(d);
n := round(frac(d) * 1000);
write((n div 100 + n div 10 mod 10 * 2 + n mod 10) / 2);
end.