#include <iostream>
using namespace std;
int main()
{
unsigned int n, a[99999], i, j, s, perechi=0;
cin>>n;
for(i=1;i<=n;i++)
cin>>a[i];
for(i=1;i<n;i++)
for(j=i+1;j<=n;j++)
{
s=a[i]+a[j];
while(s%2==0)
s=s/2;
if(s==1) perechi++;
}
cout<<'\n';
cout<<perechi;
return 0;
}