#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;   
#define ll long long
#define ull unsigned long long
// #define ordered_set tree<pair<ll, ll>, null_type, less<pair<ll, ll>>, rb_tree_tag, tree_order_statistics_node_update> 
ll mod=1e9+7;
#define PI 3.1415926535897932385
#define inf 9e18
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
string char_to_str(char c){string tem(1,c);return tem;}
typedef pair<long long, long long> ii;
#define S second
#define F first
ll max(ll a,ll b){if(a>b){return a;}return b;}
ll min(ll a,ll b){if(a<b){return a;}return b;}
#define MAXN 200005
// Comment this out for interactice problem
// #define endl '\n'
// string to integer stoi() Remember: it takes string not character
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
 
// To compile--> g++ -std=c++0x -o output one.cpp
// To run--> ./output

int main() 
{ 
    fastio;
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);

    ll h,w,k;
    cin>>h>>w>>k;
    char a[h][w];
    char temp[h][w];
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            cin>>a[i][j];
            temp[i][j]=a[i][j];
        }
    }

    ll ans=0;
    ll tot_r = powl(2, h)-1;
    ll tot_c = powl(2, w)-1;

    for (int i = 0; i<=tot_r; ++i)
    {
        ll bin_r[h];
        for (int k = 0; k < h; ++k)
        {
            bin_r[k]=0;
        }

        ll xr=i;
        ll posr=0;
        while(xr>0){
            bin_r[posr]=xr%2;
            posr++;
            xr=xr/2;
        }

        for (int j = 0; j<=tot_c; ++j)
        {
            ll bin_c[w];
            for (int k = 0; k < w; ++k)
            {
                bin_c[k]=0;
            }

            ll xc=j;
            ll posc=0;
            while(xc>0){
                bin_c[posc]=xc%2;
                posc++;
                xc=xc/2;
            }

            for (int m = 0; m < h; ++m)
            {
                if(bin_r[m]==1){
                    for (int q = 0; q < w; ++q)
                    {
                        temp[m][q]='X';
                    }
                }
            }

            for (int m = 0; m < w; ++m)
            {
                if(bin_c[m]==1){
                    for (int q = 0; q < h; ++q)
                    {
                        temp[q][m]='X';
                    }
                }
            }

            ll tot=0;
            for (int m = 0; m < h; ++m)
            {
                for (int q = 0; q < w; ++q)
                {
                    if(temp[m][q]=='#'){
                        tot++;
                    }
                }
            }

            if(tot==k){
                ans++;
            }

            // for (int m = 0; m < 6; ++m)
            // {
            //     for (int q = 0; q < 6; ++q)
            //     {
            //         cout<<temp[m][q]
            //     }
            // }

            for (int m = 0; m < h; ++m)
            {
                for (int q = 0; q < w; ++q)
                {
                    temp[m][q]=a[m][q];
                }
            }

        }
    }

    cout<<ans;

    return 0;
}

Measured memory_bytes: 3708