#include <bits/stdc++.h>
using namespace std;

#define ls n << 1
#define rs n << 1 | 1
#define PB push_back
#define MP make_pair
#define LD double
#define int long long
#define LL long long
#define pii pair<int, int>
#define fi first
#define se second
const int N = 1e5;
const int M = 300;
const int mod = 1e9 + 7;
const LL inf = 1e18;
// inline char nc() {
//     static char buf[1000000], *p1 = buf, *p2 = buf;
//     return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
// }
// #define getchar nc
inline int read() {
	int s = 0;
	register bool neg = 0;
	register char c = getchar();
	for (; c < '0' || c > '9'; c = getchar())
		neg |= (c == '-');
	for (; c >= '0' && c <= '9'; s = s * 10 + (c ^ 48), c = getchar())
		;
	s = (neg ? -s : s);
	return s;
}

int a, b, h[2];
char s[N + 10][21];

signed main() {
	// freopen("in1.in", "r", stdin);  
	// freopen("out.out", "w", stdout);
	a = read();
	b = read();
	int ans=0;
	for (int i = 1; i <= a; i++) {
		scanf("%s", s[i] + 1);
		int val=0;
		for (int j = 1; j <= b; j++) val ^= (s[i][j]=='1');
		h[val]++;
	}
	printf("%lld", h[0]*h[1]);
	return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
using namespace std;

using ll = long long;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

ll cnt[10000000];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int N, M;
    cin >> N >> M;
    vector<string> s(N);
    for(int i = 0; i < N; ++i){
        cin >> s[i];
        cnt[stoi(s[i], nullptr, 2)] += 1;
    }

    ll ans = 0;
    ll odd = 0, even = 0;
    for(int mask = 0; mask < 1 << M; ++mask){
        int popcnt = __builtin_popcount(mask);
        if(popcnt % 2 == 0){
            even += cnt[mask];
        }
        else{
            odd += cnt[mask];
        }
    }

    ans += odd * even;

    cout << ans << endl;

    return 0;
}