var
number, sum: integer;
begin
sum := 0;
number := 8267;
repeat
while number <> 0 do begin
sum := sum + (number mod 10);
number := number div 10
end
until (sum / 10) <> 0;
writeln(sum)
end.
dmFyCiAgICBudW1iZXIsIHN1bTogaW50ZWdlcjsKCmJlZ2luCiAgICBzdW0gOj0gMDsKICAgIG51bWJlciA6PSA4MjY3OwoKICAgIHJlcGVhdAogICAgICAgIHdoaWxlIG51bWJlciA8PiAwIGRvIGJlZ2luCiAgICAgICAgICAgIHN1bSA6PSBzdW0gKyAobnVtYmVyIG1vZCAxMCk7CiAgICAgICAgICAgIG51bWJlciA6PSBudW1iZXIgZGl2IDEwCiAgICAgICAgZW5kCiAgICB1bnRpbCAoc3VtIC8gMTApIDw+IDA7CgogICAgd3JpdGVsbihzdW0pCmVuZC4=