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

typedef long long ll;

int main(){

    //freopen("D://input.txt", "r", stdin);

    int n, m;
    cin >> n >> m;
    vector<int> v(n);
    vector<int> x(2, 0);
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        int total = 0;
        int bit_count = 0;
        for(int j = 0; j < m; j++){
            total *= 2;
            total += s[j]=='1';
            bit_count += s[j]=='1';
        }
        v[i] = total;
        x[bit_count%2]++;
    }

    ll ans = 1LL * x[0] * x[1];
    cout << ans << endl;

}

#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	rep(i,n) cin >> a[i];
	rep(i,n) cin >> b[i];
	int cnt = 0;
    for (int i = 0; i <= 1000; ++i)
    {
    	bool ok = true;
    	rep(j,n){
    		if(i < a[j] || i > b[j] ){
               ok = false;
    		}
    	}
    	if(ok) cnt++;		
    }
    cout << cnt << endl;
	return 0;
    
}
