#include <bits/stdc++.h>          
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repp(i, st, en) for (ll i = (ll)st; i < (ll)(en); i++)
#define repm(i, st, en) for (ll i = (ll)st; i >= (ll)(en); i--)
#define All(v) v.begin(), v.end()
#define rAll(v) v.rbegin(), v.rend()
template<class in_chmax> void chmax(in_chmax &x, in_chmax y) {x = max(x,y);}
template<class in_chmin> void chmin(in_chmin &x, in_chmin y) {x = min(x,y);}
void Yes() {cout << "Yes" << endl; exit(0);}
void No() {cout << "No" << endl; exit(0);}
template<class in_Cout> void Cout(in_Cout x) {cout << x << endl; exit(0);}
template<class in_vec_cout>
void vec_cout(vector<in_vec_cout> vec) {
    for (in_vec_cout res : vec) {cout << res << " ";}
    cout << endl;
}

const ll inf = 1e18;
const ll mod = 1e9 + 7;

int main() {
    ll N, M; cin >> N >> M;
    
    vector<ll> cnt(2);
    rep(i,N) {
        string S; cin >> S;
        ll v = 0;
        rep(j,M) if (S[j]-'0') v++;
        cnt[v%2]++;
    }

    ll ans = 1;
    rep(i,2) ans *= cnt[i];
    Cout(ans);
}
#include <iostream>
#include <string>
using namespace std;
typedef long long ll;
string s[100010];
ll cnt[1<<20] = {};
int main(){
    int i,j,n,m; cin >> n >> m;
    ll od = 0,ev = 0;
    for(i=0;i<n;i++){
        cin >> s[i];
        int cnt = 0;
        for(j=0;j<m;j++) cnt += s[i][j] - '0';
        if(cnt&1) od++;
        else ev++;
    }
    cout << od*ev << endl;
}