#include<iostream>
#include<cstdio>
#include<ctime>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<vector>
#include<iomanip>
#include<fstream>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<sstream>
using namespace std;
#define sync std::ios::sync_with_stdio(false);std::cin.tie(0)
//string::npos

const double pi = 3.141592653589;
const int maxn = 500002;
const int maxm = 26;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
typedef long long ll;



int main(){
    sync;

    ll ans = 0;
    int n, m;
    cin >> n >> m;
    string t;
    for(int i = 1; i <= n; ++i){
        cin >> t;
        int cnt=0;
        for(int j = 0; j < m; ++j){
            if(t[j]=='1') cnt++;
        }
        if(cnt&1) ans++;
    }
    cout << ans*(n-ans) << endl;


	return 0;
}



#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <time.h>
#include <unordered_map>
#include <unordered_set>

//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

using namespace std;
using ll = long long;
using LL = long long;

typedef std::pair<int, int> pii;
typedef std::pair<int, double> pid;
typedef std::vector<int> vi;
typedef std::vector<pii> vii;

const double PI = 3.14159265358979323846264338327950L;
const int mod = 1e9+7;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

const ll INF = 1LL<<60;

struct container {
    int bottom, top, id;
    container(int id, int bottom, int top) : top(top), bottom(bottom), id(id) {
    }
};


struct Edge {
    ll to, from, cost;
    Edge(ll to, ll from, ll cost) :to(to), from(from), cost(cost) {}
    Edge(): to(-1), from(-1), cost(0){}
};

struct Data {
    ll cost,val;
    Data(ll cost=0, ll val=0) : cost(cost), val(val){}
    bool operator<(const Data& a) const {
        return cost > a.cost;
    }
};



struct edge{
    int a,b,c;
    edge(int a = -1,int b = -1, int c = -1):a(a),b(b),c(c){}
    bool operator<(const edge& a) const {
        return c > a.c;
    }
};


struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};



void solve(){
    int n,m;
    cin >> n >> m;
    ll ans = 0;
    vector<ll> cntr(2);
    rep(i,n){
        int cnt = 0;
        string s;
        cin >> s;
        for(auto e:s){
            if (e=='1') cnt^=1;
        }
        cntr[cnt]++;
    }
    cout << cntr[0]*cntr[1];
}

int main() {
    int T = 1;
    // cin >> T;

    while (T--) {
        solve();
        // cout << endl;
    }
}












