var a:array [1..100] of integer;
i,n,dem:integer;
begin
write('Nhap so luong so N = ');readln(n);
for i:=1 to n do
begin
write('Nhap vao so thu ',i,': ');readln(a[i]);
if a[i] mod 3 = 0 then dem:=dem+1;
end;
write('Co ',dem,' so chia het cho 3');
readln;
end.
#include <bits/stdc++.h>
using namespace std;
long long a[1000],i,n,dem;
int main()
{
cin>>n;
for (i=1; i<=n; i++) cin>>a[i];
dem=0;
for (i=1; i<=n; i++)
if (a[i]%3==0) dem++;
cout<<dem;
return 0;
}