1.
program prog1;
var a,s:integer;
begin
s:=0;
repeat
begin
read(a);
if (a mod 2 = 0) and (a mod 5 = 0) and (a<>0) then
s:=s+1;
end
until a=0;
writeln(s);
end.
2.
program prog2;
var a,s:integer;
begin s:=0;
repeat
read(a);
if (a mod 8=0) and (a mod 10 = 6) and (a<>0) then
s:=s+a;
until a=0;
writeln(s);
end.
3.
program prog3;
var a,s:integer;
begin
s:=0;
repeat
read(a);
if (a mod 3 = 0) and (a mod 10 = 8) and (a<>0) then
s:=s+a;
until a=0;
writeln(s);
end.