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

const ll MOD = 1e9 + 7;

int mpow(int base, int exp);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define fo(i,n) for(i = 0;i < n; i++)
#define Fo(i,k,n) for(i = k;k < n ? i < n : i > n; k < n ? i += 1 : i -= 1)
#define deb(x) cout << #x << " = " << x << endl
#define deb2(x, y) cout << #x << " = " << x << ", " << #y << " = " << y << endl
#define deb3(x, y, z) cout << #x << " = " << x << ", " << #y << " = " << y << ", "<< #z << " = " << z << endl

ll randGen(ll lower, ll upper) { return (rand() % (upper - lower + 1)) + lower; }
ll dir[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
// cout << fixed;
// cout.precision(10);
//******************          Function here          *********************//

   void test_case(){
	int n, a, b;
     cin >> n >> a >> b;
     cout << n - a + b << endl;
   }

//*********************************************************************//

int main()
{
    #ifndef ONLINE_JUDGE
      string inputFile, outputFile;
      inputFile = "input.txt";
      outputFile = "output.txt";
      freopen(inputFile.c_str(), "r", stdin);
      freopen(outputFile.c_str(), "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1;
    // cin >> t;
    while(t-- > 0){
      test_case();
    }
    return 0;
}



/**********************   Utility Functions  *****************************/
   int mpow(int base, int exp) {
     base %= MOD;
     int result = 1;
     while (exp > 0) {
       if (exp & 1) result = ((ll)result * base) % MOD;
       base = ((ll)base * base) % MOD;
       exp >>= 1;
     }
     return result;
   }
/***********************************************************************/

#include <bits/stdc++.h>
#define pb(x) push_back(x)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define F(w,x,y) for(ll w=x; w<y; w++)
#define endl "\n"
#define mod 1000000007
#define INF 1000000000
typedef long long ll;
typedef long double ld;
using namespace std;

void play()
{
    ll n,m;
    cin>>n>>m;
    string s;
    ll arr[2]={0,0};
    F(i,0,n)
    {
        cin>>s;
        ll sum=0;
        F(j,0,m)
        {
            sum+=s[j]-'0';
        }
        arr[sum%2]++;
    }
    cout<<arr[0]*arr[1]<<endl;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    t=1;
    //cin>>t;
    F(i,1,t+1)
    {
        //cout<<"Case #"<<i<<": ";
        play();
    }
    return 0;
}
