#include <iostream>
#include <string>
#include <vector>
#include <iomanip>

using namespace std;

int main()
{
    int H, W, K;
    vector<vector<bool>> grid;

    //入力を受け取る
    cin >> H >> W >> K;

    grid.resize(H);
    for(auto& col : grid)
    {
        col.resize(W);
        string input;
        cin >> input;
        for(int i = 0; i < W; ++i)
        {
            col[i] = input[i] == '#' ? true : false;
        }
    }

    //行・列で見た時の黒の数をカウントする
    vector<int> hcount(H), wcount(W);
    int total = 0;
    for(int i = 0; i < H; ++i)
    {
        for(int j = 0; j < W; ++j)
        {
            int val = (grid[i][j] ? 1 : 0);
            hcount[i] += val;
            wcount[j] += val;
            total += val;
        }
    }

    // cout << "total = " << total << endl;
    // for(int i = 0; i < H; ++i) cout << "wcount[" << i << "] = " << wcount[i] << endl;
    // for(int i = 0; i < W; ++i) cout << "hcount[" << i << "] = " << hcount[i] << endl;
    // return 0;

    int matched = 0;
    for(int a = 0; a < (1 << H); ++a)
    {
        for(int b = 0; b < (1 << W); ++b)
        {
            int subtotal = total;
            //cout << "H = " << a << " W = " << b << endl;

            //行から消す
            for(int c = 0; c < H; ++c)
            {
                if((a >> c) & 1)
                {
                    subtotal -= hcount[c];
                    //cout << "total = " << setbase(10) << subtotal << endl;
                }
            }

            //次に列を消すが、行で消した分と合わせて余分に消さないようにする
            for(int d = 0; d < W; ++d)
            {
                if((b >> d) & 1)
                {
                    subtotal -= wcount[d];
                    for(int e = 0; e < H; ++e)
                    {
                        //消す対象になっている行でかつ列との交差点が黒の場合は余分に引いているのでsubtotalに1を足す
                        if(((a >> e) & 1) && grid[e][d])
                        {
                            subtotal += 1;
                        }
                    }
                }
            }

            if(subtotal == K) ++matched;
        }
    }

    cout << matched << endl;
    return 0;

    for(int x = 0; x < (1 << (H + W)); ++x)
    {
        int subtotal = total;
        //HHHHHHWWWWWW
        int hmask = x >> W, wmask = x & ((1 << W) - 1);
        cout << "H = " << setbase(16) << hmask << " W = " << setbase(16) << wmask << endl;


        //横から消す
        for(int i = 0; i < H; ++i)
        {
            if((hmask >> i) & 1)
            {
                subtotal -= wcount[i];
                //cout << "total = " << setbase(10) << subtotal << endl;
            }
        }
        //if(subtotal < K) continue;

        //縦を消す　その際に既に消した箇所は無駄にひかないようにする
        for(int i = 0; i < W; ++i)
        {
            if((wmask >> i) & 1)
            {
                subtotal -= hcount[i];
                //cout << "total = " << setbase(10) << subtotal << endl;

                for(int j = 0; j < H; ++j)
                {
                    if((hmask >> j) & 1)
                    {
                        if(grid[i][j]) ++subtotal;
                        //cout << "grid[" << i << "][" << j << "] = " << grid[i][j] << endl;
                    }
                }
            }
        }
        cout << subtotal << endl;
        if(subtotal == K) ++matched;
    }

    cout << matched << endl;

    return 0;
}

Measured memory_bytes: 3156