var
n, kol, i, ch: integer;
begin
readln(n);
kol := 0;
for i := 1 to n do
readln(ch);
if (ch mod 10 = 1) and (ch mod 7 = 0) and (ch <= 999) and (ch >= 100) then kol += 1;
end;
writeln(kol);
end.
var
n, kol, i, ch: integer;
begin
readln(n);
kol := 0;
for i := 1 to n do
begin
readln(ch);
if (ch mod 10 = 1) and (ch mod 7 = 0) and (ch <= 999) and (ch >= 100) then kol += 1;
end;
writeln(kol);
end.