#include<bits/stdc++.h>
using namespace std;
#define int long long
#define TEST int t; cin>>t; while(t--)
#define pb push_back
#define pii pair <int, int>
#define vi vector <int>
#define ff first
#define ss second
#define vpii vector <pair <int, int>>
#define vvi vector <vector <int> >
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define endl "\n"
#define MAX 1e18
#define MIN INT_MIN
#define mod 1000000007

int lcm(int a, int b) {return (a * b) / (__gcd(a, b));}
//----------------------------------SEIVE---------------------------------------------//
vector<int>prime;
bitset<1000030>vis;
void seive()
{

  vis.set();
  vis[0] = false;
  vis[1] = false;
  vis[2] = true;
  prime.pb(2);

  for (int i = 3; i <= 1000030; i += 2)

    if (vis[i] == 1)
    {
      prime.pb(i);
      for (int j = i * i; j <= 1000030; j += i)
      {
        vis[j] = 0;
      }
    }

}
//----------------------------------SEIVE---------------------------------------------//

// bool isPrime(int n)
// {
//   if (n < 2) return false;
//   if (n < 4) return true;
//   if (!(n & 1))   return false;
//   if (n % 3 == 0) return false;

//   int lim = sqrt(n);
//   for (int i = 5; i <= lim; i += 6)
//     if (n % i == 0 || n % (i + 2) == 0)
//       return false;

//   return true;
// }

// map<int, int> primeFact(int n) {
//   map<int, int> mp;
//   while (n % 2 == 0) {
//     mp[2]++;
//     n = n / 2;
//   }
//   for (int i = 3; i <= sqrt(n); i += 2) {
//     while (n % i == 0) {
//       mp[i]++;
//       n = n / i;
//     }
//   }
//   if (n > 2) {
//     mp[n]++;
//   }
//   return mp;
// }

// int binomialCoeff(int n, int k)
// {
//   if (k > n)return 0;
//   int C[n + 1][k + 1];
//   int i, j;
//   for (i = 0; i <= n; i++) {
//     for (j = 0; j <= min(i, k); j++) {
//       if (j == 0 || j == i)
//         C[i][j] = 1;
//       else
//         C[i][j] = (C[i - 1][j - 1] % (mod) + C[i - 1][j] % (mod)) % (mod);
//     }
//   }

//   return C[n][k];
// }

// int countDivisors(int n) {
//   int cnt = 0;
//   for (int i = 1; i <= sqrt(n); i++) {
//     if (n % i == 0) {
//       if (n / i == i)cnt++;
//       else {
//         cnt += 2;
//       }
//     }
//   }
//   return cnt;
// }

// int reverse_number(int n) {
//   int rev = 0, r;
//   while (n != 0) {
//     r = n % 10;
//     rev = rev * 10 + r;
//     n /= 10;
//   }
//   return rev;
// }

// int perfectSquare(int n) {
//   int h = n & 0xF;
//   if (h > 9)return 0;
//   if (h != 2 && h != 3 && h != 5 && h != 6 && h != 7 && h != 8) {
//     int x = (int)floor(sqrt((double)n) + 0.5);
//     return x * x == n;
//   }
//   return 0;
// }


void solve() {

  int n;
  cin >> n;
  int m;
  cin >> m;
  int c1 = 0;
  int o = 0;
  for (int i = 0; i < n; i++) {
    string s; cin >> s;
    c1 = 0;
    for (auto p : s) {
      if (p == '1')c1++;
    }
    if (c1 & 1)o++;
  }
  cout << o*(n - o) << endl;

}
signed main()
{
// #ifndef ONLINE_JUDGE
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
// #endif
  mt19937_64 rnd(chrono::system_clock::now().time_since_epoch().count());
  ios_base :: sync_with_stdio(0);
  cin.tie(0);
  //seive();

  //TEST
  solve();

}
#define nl                  "\n"
#define ll                  long long
#define ull                 unsigned long long
#define pb                  push_back
#define SIZE(a)             (int)a.size()
#define SORT(v)             sort(v.begin(),v.end())
#define RSORT(v)            sort(v.rbegin(),v.rend())
#define REV(v)              reverse(v.begin(),v.end())
#define ff                  first
#define ss                  second
#define sq(a)               ((a)*(a))
#define For(i,a,b)          for(i=a;i<=b;i++)
#define Rof(i,a,b)          for(i=a;i>=b;i--)
#define Rep(i,b)            for(i=0;i<b;i++)
#define MOD                 1000000007
#define PI                  acos(-1.0)
#define eps                 1e-9
#define Linf                2e18
#define inf                 1<<30
#define MX5                 100005
#define MX6                 1000006
#define MX3                 1005
#define GCD(a,b)            __gcd(a,b)
#define Abs(a)              abs(a)
#define input(a,b)          scanf("%lld%lld",&a,&b)
#define in1(a)              scanf("%lld",&a)
#define output(a)           printf("%lld\n",a);
#define mem(a)              memset(a,-1,sizeof(a)) // complexity O(n)
#define clr(a)              memset(a,0,sizeof (a))
#define mk                  make_pair
#define pLL                 pair<ll,ll>
#define invcos(a)           (acos(a)*(180/3.14159265))
#define rtan(a)             (tan(a*3.14159265/180.0))
#define pip                 printf("pip")
#define Case(x)             printf("Case %lld: ",x)
#define timelimit           1.0*clock()/CLOCKS_PER_SEC
#define pc_one              __builtin_popcount
#define pcl_one             __builtin_popcountl
#define pcll_one            __builtin_popcountll
#define parity              __builtin_parity
#define parityl             __builtin_parityl
#define parityll            __builtin_parityll
#define infile              freopen("input.txt","r",stdin)
#define outfile             freopen("output.txt","w",stdout)
#define debug(x)            cerr << #x << " is " << x << endl
#define fast                ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(0);
//const ll Linf=2e18;
///4direction ->        int del_x[]={-1,0,1,0},del_y[]={0,1,0,-1};
///8direction ->        int del_x[]={-1,0,1,0,1,-1,-1,1},del_y[]={0,1,0,-1,-1,-1,1,1};


#include <bits/stdc++.h>
/*#include <iomanip>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>*/
using namespace std;
/*using namespace __gnu_pbds;

typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
*/
ll bigmod(ll n, ll p) {if (p == 0) return 1; if (p == 1)return (n + MOD) % MOD; if (p % 2)return (bigmod(n, p - 1) * n + MOD) % MOD; else {ll x = bigmod(n, p / 2); return (x * x + MOD) % MOD;}}
ll modinverse(ll n) {return bigmod(n, MOD - 2) % MOD;}
bool check_2s_power(ll a) {return (pcll_one(a) == 1 ? true : false);}
ll check_Bit(ll n,ll k){ if(n & (1LL << k)) return true; return false; }
ll setBit(ll n, ll k){ return (n | (1LL << k)); }
ll clearBit(ll n,ll k){ return (n & (~(1LL << k))); }
ll toggleBit(ll n,ll k){ return (n ^ (1LL << k)); }

/*----------------------Graph Moves----------------*/
//const int fx[]={+1,-1,+0,+0};
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*------------------------------------------------*/

int main()
{
    ll i,j,n,m,milse=0,milenai=0;
    string s,p;
    input(n,m);
    cin >> s;
    n--;
    vector<string>v(n);
    Rep(i,n)
    {
        cin >> p;
        ll counter=0;
        Rep(j,m)
        {
            if(s[j]!=p[j]) counter++;
        }
        //cout << counter << endl;
        if(counter%2) milenai++;
    }
    milse=n+1-milenai;
    output(milse*milenai);
}
