#include<iostream>
#include<string>
using namespace std;
typedef long long ll;
int main()
{
  int n,m,t,i,j;
  ll r[2];
  string s;
  cin >> n >> m;
  r[0]=0; r[1]=0;
  for(i=0;i<n;i++){
    cin >> s;
    t=0;
    for(j=0;j<m;j++)
      if(s[j]=='1')
        t++;
    r[t%2]++;
  }
  cout << r[0]*r[1] << endl;
  return 0;
}
#include "bits/stdc++.h"
using namespace std;
#define ll long long
#define pb push_back
#define all(_obj) _obj.begin(),_obj.end()
#define F first
#define S second
#define INF 1e18
#define pll pair<ll, ll> 
#define vll vector<ll>
ll n,m,a,b,c,k,temp,x,y;
const int MAXN=1e5+11,mod=998244353;
ll max(ll a,ll b) {return ((a>b)?a:b);}
ll min(ll a,ll b) {return ((a>b)?b:a);}
vll read(int n) {vll v(n);for (int i = 0; i < v.size(); i++)cin>>v[i];return v;}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dp[3001][7000];
ll rec(int n,int k)
{
    if(dp[n][k]!=-1) return dp[n][k];
    if(n && !k) return dp[n][k]=0;
    if(n<k) return dp[n][k]= 0;
    if(n==k) return dp[n][k]=1;
    return dp[n][k]=(rec(n-1,k-1)+rec(n,2*k))%mod;
}
void sol(void)
{
memset(dp,-1,sizeof(dp));
cin>>n>>k;
cout<<rec(n,k);
return ;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int test=1;
    //cin>>test;
    for(int i=1;i<=test;i++)
    sol();
}
