#include <bits/stdc++.h>
#include <unordered_set>
#include <algorithm>
 
using namespace std;
 
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
 
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repll(i,n) for (ll i = 0; i < (ll)(n); i++)
#define fore(x,a) for(auto&(x) : (a))
 
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
#define ALL(a) (a).begin(), (a).end()
 
const ll INFL = 1e18;
const int INFI = 1e9;
const int MOD = 1e9 + 7;

const int MAX = 30;
ll dp[MAX+1][MAX+1];

string  find_kth(int A,int B,ll K) {
    if(A == 0) {
      return string(B,'b');
    }
    if(B == 0) {
      return string(A,'a');
    }
    if(K <= dp[A-1][B]) {
      return string("a") + find_kth(A-1,B,K);
    }
    else {
      return string("b") + find_kth(A,B-1,K-dp[A-1][B]);
    }
  }

int main(){
  int A,B;
  ll K;
  cin >> A >> B >> K;
  dp[0][0] = 1;
  for (int i = 0; i <= A; i++) {
    for (int j = 0; j <= B; j++) {
      if(i > 0) {
        dp[i][j] += dp[i-1][j];
      }
      if(j > 0) {
        dp[i][j] += dp[i][j-1];
      }
    }
  }
  cout << find_kth(A,B,K) << endl;
}
#include<bits/stdc++.h>
using namespace std;
int n,m,x[101010],y[101010];
long long ans=0;
map<pair<int,int>,int>mp;
string s;
int main()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	{
		cin>>s;
		for(int j=0;j<m;j++)
		{
			if(s[j]=='0')
			{
				x[i]++;
			}
			else
			{
				y[i]++;
			}
		}
		mp[make_pair(x[i],y[i])]++;
	}
	for(int i=1;i<=n;i++)
	{
		int nw=1;
		while((y[i]-nw)>=0)
		{
			ans+=mp[make_pair(x[i]+nw,y[i]-nw)];
			nw+=2;
		}
		nw=1;
		while((x[i]-nw)>=0)
		{
			ans+=mp[make_pair(x[i]-nw,y[i]+nw)];
			nw+=2;
		}
	}
	cout<<ans/2<<endl;
	return 0;
}