#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#define endl "\n"
#define int long long
#define debug(x) cout << #x << " is " << x << endl;
using namespace std;
int k;
int ok(vector <int> &boolw, vector <int>& boolh, vector <string> grid) {
    for (int i = 0; i < boolh.size(); ++i) {
        if (boolh[i]) {
            for (int j = 0; j < boolw.size(); ++j) grid[i][j] = '0';
        }
    }
    for (int i = 0; i < boolw.size(); ++i) {
        if (boolw[i]) {
            for (int j = 0; j < boolh.size(); ++j) grid[j][i] = '0';
        }
    }
    int ans = 0;
    for (int i = 0; i < boolh.size(); ++i) {
        for (int j = 0; j < boolw.size(); ++j) if (grid[i][j] == '#') ++ans;
    }
    if (ans == k) return 1;
    return 0;
}

int cou(int w, vector <int>& boolh, vector <string> grid) {
    int ans = 0;
    vector <int> boolw(w, 0);
    for (int i1 = 0; i1 < 2; ++i1) {
        boolw[0] = 1 - boolw[0];
        if (w == 1) ans += ok(boolw, boolh, grid);
        else for (int i2 = 0; i2 < 2; ++i2) {
            boolw[1] = 1 - boolw[1];
            if (w == 2) ans += ok(boolw, boolh, grid);
            else for (int i3 = 0; i3 < 2; ++i3) {
                boolw[2] = 1 - boolw[2];
                if (w == 3) ans += ok(boolw, boolh, grid);
                else for (int i4 = 0; i4 < 2; ++i4) {
                    boolw[3] = 1 - boolw[3];
                    if (w == 4) ans += ok(boolw, boolh, grid);
                    else for (int i5 = 0; i5 < 2; ++i5) {
                        boolw[4] = 1 - boolw[4];
                        if (w == 5) ans += ok(boolw, boolh, grid);
                        else for (int i6 = 0; i6 < 2; ++i6) {
                            boolw[5] = 1 - boolw[5];
                            if (w == 6) ans += ok(boolw, boolh, grid);
                        }
                    }
                }
            }
        }
    }
    return ans;
}
signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cout << fixed << setprecision(2);
    int h, w, ans = 0; cin >> h >> w >> k;
    vector <string> grid(h);
    for (auto& x : grid) cin >> x;
    vector <int> boolh(h, 0), boolw(w, 0);
    for (int i1 = 0; i1 < 2; ++i1) {
        boolh[0] = 1 - boolh[0];
        if (h == 1) ans += cou(w, boolh, grid);
        else for (int i2 = 0; i2 < 2; ++i2) {
            boolh[1] = 1 - boolh[1];
            if (h == 2) ans += cou(w, boolh, grid);
            else for (int i3 = 0; i3 < 2; ++i3) {
                boolh[2] = 1 - boolh[2];
                if (h == 3) ans += cou(w, boolh, grid);
                else for (int i4 = 0; i4 < 2; ++i4) {
                    boolh[3] = 1 - boolh[3];
                    if (h == 4) ans += cou(w, boolh, grid);
                    else for (int i5 = 0; i5 < 2; ++i5) {
                        boolh[4] = 1 - boolh[4];
                        if (h == 5) ans += cou(w, boolh, grid);
                        else for (int i6 = 0; i6 < 2; ++i6) {
                            boolh[5] = 1 - boolh[5];
                            if (h == 6) ans += cou(w, boolh, grid);
                        }
                    }
                }
            }
        }
    }
    cout << ans << endl;


}

Measured memory_bytes: 3644