#include <bits/stdc++.h>
using namespace std;
long long a[15],n,i,dem;
int main()
{
freopen("songuyen.inp","r",stdin);
freopen("ketqua.out","w",stdout);
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;
}