#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;


int main() {
    int h,w,k;
    cin >> h >> w >> k;
    vector<vector<int>> data(6,vector<int>(6,0));

    int b_count = 0;

    for(int i = 0 ; i < h ; i++){
        string temp;
        cin >> temp;
        for(int j = 0 ; j < w ; j++){
            if(temp.at(j) == '.'){
                data.at(i).at(j) = 0;
            }else{
                data.at(i).at(j) = 1;
                b_count++;
            }
        }
    }

    vector<int> gyou_count(6,0);
    vector<int> retu_count(6,0);

    for(int i = 0 ; i < h ; i++){
        int temp = 0;
        for(int j = 0 ; j < w ; j++){
            temp += data.at(i).at(j);
        }        
        gyou_count.at(i) = temp;
    }
    for(int j = 0 ; j < w ; j++){
        int temp = 0;
        for(int i = 0 ; i < h ; i++){
            temp += data.at(i).at(j);
        }        
        retu_count.at(j) = temp;
    }


    int result = 0;

    for(int i = 0 ; i < pow(2, h) ; i++){
        for(int j = 0 ; j < pow(2, w) ; j++){
            //cout << i << " " << j << endl;

            int temp = 0;

            vector<int> gyou_num;
            vector<int> retu_num;

            if((i & 0b000001) != 0){
                temp += gyou_count.at(0);
                gyou_num.push_back(0);
                //cout << temp << endl;
            }
            if((i & 0b000010) != 0){
                temp += gyou_count.at(1);
                gyou_num.push_back(1);
                //cout << temp << endl;
            }
            if((i & 0b000100) != 0){
                temp += gyou_count.at(2);
                gyou_num.push_back(2);
                //cout << temp << endl;
            }
            if((i & 0b001000) != 0){
                temp += gyou_count.at(3);
                gyou_num.push_back(3);
                //cout << temp << endl;
            }
            if((i & 0b010000) != 0){
                temp += gyou_count.at(4);
                gyou_num.push_back(4);
                //cout << temp << endl;
            }
            if((i & 0b100000) != 0){
                temp += gyou_count.at(5);
                gyou_num.push_back(5);
                //cout << temp << endl;
            }
            //cout << temp << endl;

            if((j & 0b000001) != 0){
                temp += retu_count.at(0);
                retu_num.push_back(0);
            }
            if((j & 0b000010) != 0){
                temp += retu_count.at(1);
                retu_num.push_back(1);
            }
            if((j & 0b000100) != 0){
                temp += retu_count.at(2);
                retu_num.push_back(2);
            }
            if((j & 0b001000) != 0){
                temp += retu_count.at(3);
                retu_num.push_back(3);
            }
            if((j & 0b010000) != 0){
                temp += retu_count.at(4);
                retu_num.push_back(4);
            }
            if((j & 0b100000) != 0){
                temp += retu_count.at(5);
                retu_num.push_back(5);
            }

            //if(b_count - temp > k){
            //    continue;
            //}

            //cout << temp << endl;

            for(int m = 0 ; m < gyou_num.size() ; m++){
                for(int n = 0 ; n < retu_num.size() ; n++){
                    if(data.at(gyou_num.at(m)).at(retu_num.at(n)) == 1){
                        temp--;
                    }
                }
            }

            if(b_count - temp == k){
                result++;
            }
        }
    }
    
    cout << result << endl;
}

Measured memory_bytes: 4052