#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 ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
        #define ll long long
        #define int long long
        #define lb long double
        #define f(i,a,b) for(int i=(a);i<=(b);i++)
        #define fd(i,a,b) for(int i=a;i>=b;i--)
        #define vi vector<int>
        #define mii map<int,int>
        #define pii pair<int,int>
        #define si set<int>
        #define pb push_back
        #define mk make_pair
        #define fi first
        #define se second
        #define fv(i,v) for(auto i=v.begin();i!=v.end();++i)
        #define fdv(i,v) for(auto i=v.rbegin();i!=v.rend();++i)
        #define print(a,n) f(i,1,n) cout<<a[i]<<" "; cout<<endl;
        #define printv(v) for(auto iv: v) cout<<iv<<" "; cout<<endl;
        #define all(v) v.begin(),v.end()
        #define r(a,n) ll a[n+1]; f(i,1,n) cin>>a[i];
        #define pi 3.141592653589793238
        const int mod=1e9+7;
        const int inf=1e18;
        int parent[26];
        int size[26];
        const int MAXN=2*1e5+1;
        int spf[MAXN];
        int popcount[MAXN];
        //vector<bool> vis(MAXN);

        ll power(ll x, unsigned ll y)
        {
            ll res = 1;
            while (y > 0)
            {
                if (y & 1)
                    res = res*x;
                y = y>>1;
                x = x*x;
            }
            return res;
        }

        bool isPrime(int n)
        {
            if (n <= 1)
                return false;
            if (n <= 3)
                return true;

            if (n % 2 == 0 || n % 3 == 0)
                return false;

            for (int i = 5; i * i <= n; i = i + 6)
                if (n % i == 0 || n % (i + 2) == 0)
                    return false;

            return true;
        }
        void sieve()
        {
            spf[1] = 1;
            for (int i=2; i<MAXN; i++)
                spf[i] = i;
            for (int i=4; i<MAXN; i+=2)
                spf[i] = 2;
            for (int i=3; i*i<MAXN; i++)
            {
                if (spf[i] == i)
                {
                    for (int j=i*i; j<MAXN; j+=i)
                        if (spf[j]==j)
                            spf[j] = i;
                }
            }
        }

        int lcm(int a, int b)
        {
            return (a*b)/__gcd(a,b);
        }
        bool sortcol( const vector<int>& v1,
                       const vector<int>& v2 ) {
         return v1.size() >= v2.size();
                       }
        unsigned int countSetBits(unsigned int n)
        {
            unsigned int count = 0;
            while (n) {
                count += n & 1;
                n >>= 1;
            }
            return count;
        }

        string decTobin(int n)
        {
            string s={};
            while(n>0)
            {
                if(n%2==0)s.append("0");else s.append("1");
                n/=2;
            }
            return s;
        }
        signed main()
        {
            ios_base::sync_with_stdio(false);
            cin.tie(0);
            int t=1;
           // cin>>t;
            while(t--)
            {
                int h,w,k;
                cin>>h>>w>>k;
                bool a[h][w];
                char c;
                f(i,0,h-1)
                f(j,0,w-1)
                {cin>>c;
                if(c=='#')a[i][j]=1;else a[i][j]=0;}
                int out=0;
                f(i,0,(1<<h)-1)
                f(j,0,(1<<w)-1)
                {
                    int cnt=0;
                    f(l,0,h-1)
                    f(n,0,w-1)
                    if(!((i&1<<l)||(j&1<<n)))
                        cnt+=a[l][n];
                    if(cnt==k)
                        out++;
                }
                cout<<out<<endl;
            }
        }

Measured memory_bytes: 3624