#include <iostream>
#include <bits/stdc++.h>
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define INF 1000000000
#define MOD 1000000007
#define M 998244353
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ll long long
#define endl "\n"
#define fori(i, a, b) for(i=a; i<b; i++)
#define ford(i, a, b) for(i=a; i>b; i--)
using namespace std;
const ll N = 500043;
ll fact[N];
ll add(ll x, ll y)
{
	x += y;
	while(x >= MOD) x -= MOD;
	while(x < 0) x += MOD;
	return x;
}
ll mul(ll x, ll y)
{
	return (x * 1ll * y) % MOD;
}
ll mulmod(ll a, ll b)
{
    ll res = 0;
    a = a % MOD;
    while (b>0)
    {
        if (b % 2 == 1)
            res = (res + a) % MOD;
        a = (a * 2) % MOD;
        b /= 2;
    }
    return res % MOD; 
}
ll binpow(ll x, ll y)
{
	ll z = 1;
	while(y > 0)
	{
		if(y % 2 == 1)
			z = mul(z, x);
		x = mul(x, x);
		y /= 2;
	}
	return z;
}
ll inv(ll x)
{
	return binpow(x, MOD - 2);
}
ll divide(ll x, ll y)
{
	return mul(x, inv(y));
}
void precalc()
{
	fact[0] = 1;
	ll i;
	fori(i, 1, N)
		fact[i] = mul(i, fact[i - 1]);
}
ll C(ll n, ll k)
{
	if(k > n)
	    return 0;
	return divide(fact[n], mul(fact[n - k], fact[k]));
}
void swap(int* a, int* b) 
{ 
    int temp; 
    temp = *a; 
    *a = *b; 
    *b = temp; 
} 
/* Utility function that puts all  
non-positive (0 and negative) numbers on left  
side of arr[] and return count of such numbers */
int segregate(int arr[], int size) 
{ 
    int j = 0, i; 
    for (i = 0; i < size; i++) { 
        if (arr[i] <= 0) { 
            swap(&arr[i], &arr[j]); 
            j++; // increment count of non-positive integers 
        } 
    } 
  
    return j; 
} 

/* Find the smallest positive missing number  
in an array that contains all positive integers */
int findMissingPositive(int arr[], int size) 
{ 
    int i; 
  
    // Mark arr[i] as visited by making arr[arr[i] - 1] negative. 
    // Note that 1 is subtracted because index start 
    // from 0 and positive numbers start from 1 
    for (i = 0; i < size; i++) { 
        if (abs(arr[i]) - 1 < size && arr[abs(arr[i]) - 1] > 0) 
            arr[abs(arr[i]) - 1] = -arr[abs(arr[i]) - 1]; 
    } 
  
    // Return the first index value at which is positive 
    for (i = 0; i < size; i++) 
        if (arr[i] > 0) 
            // 1 is added because indexes start from 0 
            return i + 1; 
  
    return size + 1; 
} 
  
/* Find the smallest positive missing  
number in an array that contains  
both positive and negative integers */
int findMissing(int arr[], int size) 
{ 
    // First separate positive and negative numbers 
    int shift = segregate(arr, size); 
  
    // Shift the array and call findMissingPositive for 
    // positive part 
    return findMissingPositive(arr + shift, size - shift); 
} 
ll solve()
// void solve()
{
    int h, w, k, i, j, cnt = 0, bc = 0;
    cin >> h >> w >> k;
    char ch[h][w];
    int a[h], b[w];
    fori(i, 0, h)
        fori(j, 0, w)
            cin >> ch[i][j];
    fori(i, 0, h)
    {
        cnt = 0;
        fori(j, 0, w)
            if(ch[i][j] == '#')
                cnt++;
        bc += cnt;
        a[i] = cnt;
    }
    fori(i, 0, w)
    {
        cnt = 0;
        fori(j, 0, h)
            if(ch[i][j] == '#')
                cnt++;
        // bc += cnt;
        b[i] = cnt;
    }
    int ans = 0;
    char s[h][w];
    int r, c, x;
    fori(i, 0, 1<<h)
    {
        fori(j, 0, 1<<w)
        {
            fori(r, 0, h)
            {
                fori(c, 0, w)
                    s[r][c] = ch[r][c];
            }
            fori(r, 0, h)
            {
                if((1<<r) & i)
                {
                    fori(x, 0, w)
                        s[r][x] = '>';
                }
            }
            fori(c, 0, w)
            {
                if((1<<c) & j)
                {
                    fori(x, 0, h)
                        s[x][c] = '>';
                }
            }
            cnt = 0;
            fori(r, 0, h)
            {
                fori(c, 0, w)
                    if(s[r][c] == '#')
                        cnt++;
            }
            if(cnt == k)
                ans++;
        }
    }
    return ans;
}

int main()
{
    io
    int t;
    t=1;
    // cin >> t;
    while(t--)
        cout << solve() << endl;
        // solve();
    return 0;
}

Measured memory_bytes: 3656