#include <iostream>
#include <vector>
#include <string>

using namespace std;

int mask_to_int(string s)
{
    int ret = 0;
    for (size_t i = 0; i < s.size(); ++i)
        ret = (ret * 2) + (s[i] == '1');
    return ret;
}

int main()
{
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; ++i) {
        string s;
        cin >> s;
        a[i] = mask_to_int(s);
    }

    // cnt[1][x] = number of y differ x in last 10 bits that cnt diff = odd
    vector<int> cnt[2];

    const int SECOND_HALF = (1 << 10) - 1;

    cnt[0].resize(1 << 20);
    cnt[1].resize(1 << 20);

    for (int x : a) {
        int first = x >> 10;
        for (int second = 0; second < 1 << 10; ++second) {
            int p = __builtin_popcount((x & SECOND_HALF) ^ second) & 1;
            ++cnt[p][(first << 10) | second];
        }
    }

    long long res = 0;
    for (int x : a) {
        int second = x & SECOND_HALF;
        for (int first = 0; first < 1 << 10; ++first) {
            int p = __builtin_popcount((x >> 10) ^ first) & 1;
            res += cnt[!p][(first << 10) | second];     // we count pairs with odd diff, hence !p
        }
    }

    cout << res / 2;
    return 0;
}


#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("O3")
#pragma GCC target("avx,avx2,fma")
#include <algorithm>
#include <iostream>
#include <utility>
#include <cstring>
#include <cassert>
#include <vector>
#include <random>
#include <cstdio>
#include <string>
#include <queue>
#include <tuple>
#include <map>
#include <set>
#define MOD 1000000007LL
typedef long long ll;
typedef std::pair < int, int > pii;
int main() {
    ll n, k;
    scanf("%lld%lld", &n, &k);
    for (; k--; ) {
        if (n % 200 == 0) n /= 200;
        else n = n * 1000 + 200;
    }
    printf("%lld\n", n);
    return 0;
}