В паскале попробывал все получилось)
vara,b,c,e:integer;beginread(a);c:=0;for e:=1 to adobeginread(b);if b mod 10=3thenc:=c+1;end;write(c);end.