#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll=long long;
using ld=long double;
//using mint = modint1000000007;
#define rep(i,n) for (ll i=0; i<n; ++i)
#define all(c) begin(c),end(c)
#define PI acos(-1)
#define oo 2e18
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
//priority_queue<ll, vector<ll>, greater<ll>> Q;
/*
7 5
10101
00001
10001 合致する

00110
11110
00100
11111
10000
*/
int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(10);
  ll N, M;
  cin >> N >> M;
  ll odd=0, even=0;
  rep(i, N){
    string S;
    cin >> S;
    ll cnt = 0;
    rep(j, M){
      if (S[j] == '1') cnt++;
    }
    if (cnt%2) odd++;
    else even++;
  }
  cout << odd * even << endl;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n,x;
    string s;
    cin>>n>>x;
    cin>>s;
    for(ll i=0;i<n;i++)
    {
        if(s[i]=='x')
        {
            if(x!=0)
            {
             x--;   
            }
        }
        else
        {
            x++;
        }
    }
    cout<<x;
}
