var
x , counter , sum :integer;
begin
read(x);
counter := 0;
while (x <> 0) do begin
sum := sum + x;
if( x mod 5 = 0 ) and ( x mod 2 = 0 ) then
counter := counter + 1;
end;
write(sum,' ', counter);
end.
var
x , counter , sum :integer;
begin
read(x);
counter := 0;
while (x <> 0) do begin
sum := sum + x;
if( x mod 5 = 0 ) and ( x mod 2 = 0 ) then
counter := counter + 1;
read(x);
end;
write(sum,' ', counter);
end.