#include <bits/stdc++.h>

#define debug(x) cerr << #x << " = " << x << endl

using namespace std;
typedef long long LL;

const int MAXN = 3005;
const int MOD = 998244353;
int n, k, dp[MAXN][MAXN];

template <class T>
void read(T& x) {
    x = 0;
    T f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') f = (ch == '-' ? -1 : 1), ch = getchar();
    while (ch >= '0' && ch <= '9') x = x * 10 + ch - 48, ch = getchar();
    x *= f;
}

template <class T, class... Args>
void read(T& x, Args&... args) {
    read(x), read(args...);
}

template <class T>
void write(T x) {
    if (x < 0) putchar('-'), x = -x;
    if (x > 9) write(x / 10);
    putchar(x % 10 + '0');
}

int make(int n, int k) {
    if (k > n) return 0;
    if (n == k) return 1;
    if (n == 0 || k == 0) return 0;
   // cout << n << " " << k << endl;
    if (dp[n][k]) return dp[n][k];
    dp[n][k] = (make(n - 1, k - 1) + make(n, k * 2)) % MOD;
    return dp[n][k];
}

signed main() {
    // freopen("1.in", "r", stdin);
    read(n, k);
    cout << make(n, k);
    return 0;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define fore(i_in,a) for (auto& i_in: a)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fio() cin.tie(nullptr);ios::sync_with_stdio(false);
#define DEBUG_CTN(v) cerr<<#v<<":";for(auto itr=v.begin();itr!=v.end();itr++) cerr<<" "<<*itr; cerr<<endl
template<class T> bool chmax(T &a, const T &b) {if (a<b) { a = b; return true; } return 0;}
template<class T> bool chmin(T &a, const T &b) {if (a>b) { a = b; return true; } return 0;}
template<class T> void print(const T &t) { cout << t << "\n"; }
const ll INF = 1LL << 62;
const int iINF = 1 << 30;

int n,m;
string s;

int main() {
    fio(); cin>>n>>m;
    vl cnt(2,0);
    rep(i,n) {
        cin>>s;
        ll tmp=count(all(s),'1');
        cnt[tmp%2]++;
    }
    print(cnt[0]*cnt[1]);
}
//9min 1wa