var
x, count, i : integer;
begin
count := 0;
for i := 1 to 9 do
readln(x);
if (x mod 19 = 0) and (x mod 3 = 0) then
count := count + 1;
end;
writeln(count);
end.
var
x, count, i : integer;
begin
count := 0;
for i := 1 to 9 do
begin
readln(x);
if (x mod 19 = 0) and (x mod 3 = 0) then
count := count + 1;
end;
writeln(count);
end.