#include<iostream>
#include<cstdio>
using namespace std;
long long x,y;
int n,m;
int main()
{
	scanf("%d %d",&n,&m);
	string temp;
	for(int a=1;a<=n;a++)
	{
		int t=0;
		cin>>temp;
		for(int b=0;b<temp.size();b++)
		t+=temp[b]-'0';
		if(t%2==0) x++;
		else y++;
		//printf("%d\n",t);
	}
	printf("%lld",x*y);
	return 0;
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ld long double
#define ull unsigned long long int
#define ll long long int
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define rep(i,L,R) for(ll i=L;i<R;i++)
#define f(n) rep(i,0,n)
#define vll vector<ll>
#define pll pair<ll,ll>
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define PI 3.141592653589
#define DEBUG
#ifdef DEBUG
#define deb2(args...) {dbg,args; cerr<<endl;}
#else
#define deb2(args...)
#endif
struct debb{template<typename T> debb& operator,(const T &v){cerr<<v<<" ";return *this;}}dbg;
#define deb1(args...) do {cerr << #args << " : "; dbg,args; cerr << "\n";} while(0)
#define printa(a,L,R) rep(i,L,R) cout << a[i] <<' ';cout<<"\n";
typedef tree<ll,null_type,less_equal<ll>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
template<typename T>T gcd(T a,T b){if(b==0)return a;else return gcd(b,a%b);}
template<typename T>T lcm(T a,T b){return a/gcd(a,b)*b;}
template<typename T1,typename T2>ostream& operator<<(ostream& out,pair<T1,T2> a){out<<a.fr<<" "<<a.sc;return out;}
ll power(ll x,ll y,ll p){ll res=1;x=x%p;while(y>0){if(y&1)res=((res%p)*(x%p))%p;y=y>>1;x=(x*x)%p;}return res;}
ll pow1(ll x,ll y){ll res=1;while(y>0){if(y&1)res=(res*x);y=y>>1;x=x*x;}return res;}
#define sq(X) ((X)*(X))
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define mod 1000000007ll
const ll INF = 1e18l+10, MAX = 3e5+10;

void solve()
{
    ll n,j,m,i,c = 0;
    cin >> n >> m;
    string s;
    f(n)
    {
        cin >> s;
        ll t = 0;
        rep(j,0,m) if(s[j]=='1') t++;
        if(t%2) c++;
    }
    cout << c * (n - c) <<"\n";
}

int main()
{
    SPEED
    int t = 1;
    // cin >> t;
    while(t--)
    {
        solve();
    }
}