var n,s:integer; x1,x2:integer;beginwrite('Vvedite N = ');read(n);x1:=n div 1000;x2:=n mod 1000 div 100;s:=x1+x2;writeln(s);end.
var n,s:integer;
x1,x2:integer;
begin
write('Vvedite N = ');
read(n);
x1:=n div 1000;
x2:=n mod 1000 div 100;
s:=x1+x2;
writeln(s);
end.