Program arr_length;
const
IN_FILENAME = 'INPUT.txt';
OUT_FILENAME = 'OUTPUT.txt';
var
fileIn,fileOut: TextFile;
s,t: string;
begin
writeln('Загружаю входные данные...');
t := '';
AssignFile(fileIn, IN_FILENAME);
AssignFile(fileOut, OUT_FILENAME);
reset(fileIn);
while not eof(fileIn) do
begin
readln(fileIn, s);
if (s = '0') then
break
else
t := t + s;
end;
CloseFile(fileIn);
rewrite(fileOut);
writeln(fileOut, Length(t));
CloseFile(fileOut);
end.