#include<bits/stdc++.h>
// iteration and input/output stream
#define rep(i,a,b) for(int i = int(a);i<=int(b);i++)
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define printarr(x) rep(i,0,x.size()-1) cout<<x[i]<<" "; cout<<endl;
#define all(v) v.begin(),v.end()
 
#define si(x) int x; scanf("%d", &x)
#define sll(x) ll x; scanf("%lld", &x)
#define pi(x) printf("%d", x)
#define pll(x) printf("%lld", x)
#define nl printf("\n")
#define tr(cont,it) \
for(decltype(cont.begin()) it = cont.begin(); it!= cont.end() ; it++)
 
#define endl "\n"
#define tc() int t; cin >> t ; while (t--)
//STL shortcuts
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define F first
#define S second
#define MP make_pair
 
// Error detection
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
 
using namespace std;
 
typedef long long int ll; // 64 bit integer
typedef unsigned long long int  ull; // 64 bit unsigned integer
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<int,ll> pill;
 
inline void smax(int &x , int y) { x = max(x , y) ; }
inline void smin(int &x , int y) { x = min(x , y) ; }
 
#define MOD 1000000007
#define inf 4000000000000000000LL
#define SYNC std::ios::sync_with_stdio(false);  cin.tie(NULL);


void paintRow(int i,int h,int w,vector<string> &g)
{
    for (int k = 0; k < w; k++)
    {
        g[i][k] = '.';
    }
    return;
}

void paintCol(int i,int h,int w,vector<string> &g)
{
    for (int k = 0; k < h; k++)
    {
        g[k][i] = '.';
    }
    return;    
}

bool check(int h,int w,int k,vector<string> &g)
{
    int cnt =0 ;
    for (int i = 0; i < h; i++)
    {
        for (int j = 0; j < w; j++)
        {
            if(g[i][j]=='#')
            {
                cnt++;
                if(cnt>k) break;
            }
        }
    }
    return (cnt==k);
}

int main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    freopen("err.txt","w",stderr);
    #endif
    SYNC
    
    int h,w,K;
    cin>>h>>w>>K;
    vector<string> g(h);
    for (int i = 0; i < h; i++)
    {
        cin>>g[i];
    }
    int ans =0;

    for(int i =0;i<pow(2,h);i++)
    {//7 bit number, i th bit is 1 means ith row chosen
        for (int j = 0; j < pow(2,w); j++)
        {
            vector<string> cur = g;
            for(int k =0;k<h;k++)
            {
                if(1<<k & i)
                {
                    paintRow(k,h,w,cur);
                }
            }
            for(int k =0;k<w;k++)
            {
                if(1<<k & j)
                {
                    paintCol(k,h,w,cur);
                }
            }            
            if(check(h,w,K,cur))ans++;
        }
    }
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3984