#include <bits/stdc++.h>
 
#define rep(i,n) for(ll i=0;i<n;++i)
#define rrep(i, n) for(ll i=n-1;i>=0;--i)
#define rep1(i, n) for(ll i=1; i<=n; ++i)
#define repitr(itr,mp) for(auto itr=mp.begin();itr!=mp.end();++itr)
#define ALL(a) (a).begin(),(a).end()

template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

using namespace std;
using ll  = long long;
using ld = long double;
using ull = unsigned long long;
using pll = pair<ll, ll>;

const ll MOD  = 998244353;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;
const double PI = 3.1415926535897932384626;

ll mod(ll a, ll m){return (a + m) % m;}

int main(){
    ll n, m;
    cin >> n >> m;
    
    ll cnt_odd = 0;
    rep(i, n){
        string s;
        cin >> s;
        ll cnt = 0;
        for(char c: s)if(c == '1')cnt++;

        if(cnt % 2)cnt_odd++;
    }

    cout << cnt_odd * (n - cnt_odd) << endl;

}
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
#define int long long
int d[200];

signed main(){
  int n;
  cin>>n;
  int a[n];
  rep(i,n){
    cin>>a[i];
    d[a[i]%200]++;
  }
  int ans=0;
  rep(i,200){
    if(d[i]>1){
      ans+=(d[i]*(d[i]-1)/2);
    }
  }
  cout<<ans<<endl;
  return 0;
}
