#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

#define REP(k, n) for (ll k = 0; k < (ll)(n); ++k)
#define REPREV(k, n) for (ll k = (ll)(n)-1; k >= 0; --k)
#define FOR(k, a, b) for (ll k = (ll)(a); k < (ll)(b); ++k)
#define FORREV(k, a, b) for (ll k = (ll)(b)-1; k >= (ll)(a); --k)
#define FOREACH(e, v) for (auto& e : v)

#define TGET(t, i) get<i>(t)
#define TSET(t, i, a) get<i>(t) = a
// MinHeap - priority_queue<ll, vll, greater<ll>> pq;

#define EVEN(n) ((n)&1) == 0
#define ODD(n) ((n)&1) == 1

#define SORT(v) sort(v.begin(), v.end())
#define SORTREV(v) sort(v.rbegin(), v.rend())
#define SHUFFLE(v) random_shuffle(v.begin(), v.end())
//srand(unsigned(time(0)));

#define REMOVEAT(v, i) v.erase(v.begin() + i)
#define REVERSE(v) reverse(v.begin(), v.end())

ll MOD(ll x, ll m) {
    ll r = x % m;
    if (r < 0) {
        r += m;
    }
    return r;
}

ostream& operator<<(ostream& str, const pll& p) {
    str << p.first << " " << p.second;
    return str;
}

template <typename T>
void join(T& arr, string sep) {
    bool first = true;
    for (auto t : arr) {
        if (first) {
            first = false;
            cout << t;
        } else {
            cout << sep << t;
        }
    }
    cout << "\n";
}

#define POS "POSSIBLE"
#define IMPOS "IMPOSSIBLE"

// #define INF LLONG_MAX
// #define MINF LLONG_MIN
#define INF 9e18
#define MINF -INF

void solve() {
    ll n, m, k;
    cin >> n >> m >> k;
    vvll g(n, vll(m));
    vvll g2(n, vll(m));
    ll count = 0;
    REP(i, n) {
        REP(j, m) {
            char c;
            cin >> c;
            if (c == '#') {
                g[i][j] = 1;
                g2[i][j] = 1;
                count++;
            }
        }
    }

    ll res = 0;
    function<ll(ll, ll, ll)> helper = [&](ll i, ll j, ll k) {
        if (i == -1 && j == -1) {
            ll count = 0;
            REP(ii, n) {
                REP(jj, m) {
                    count += g2[ii][jj];
                }
            }
            return count == k ? 1ll : 0ll;
        }
        ll res = 0;
        if (i != -1) {
            vll prv(m);
            REP(j, m) {
                prv[j] = g2[i][j];
                g2[i][j] = 0;
            }
            ll nxti = i+1;
            if (nxti == n) {
                nxti = -1;
                j = 0;
            }
            res += helper(nxti, j, k);
            REP(j, m) {
                g2[i][j] = prv[j];
            }
            res += helper(nxti, j, k);
        } else {
            vll prv(n);
            REP(i, n) {
                prv[i] = g2[i][j];
                g2[i][j] = 0;
            }
            ll nxtj = j+1;
            if (nxtj == m) {
                nxtj = -1;
                i = -1;
            }
            res += helper(i, nxtj, k);
            REP(i, n) {
                g2[i][j] = prv[i];
            }
            res += helper(i, nxtj, k);
        }
        return res;
    };
    res = helper(0, -1, k);
    // cout << fixed << setprecision(6);
    cout << res << "\n";
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int tt = 1;
    // cin >> tt;
    for (int t = 1; t <= tt; t++) {
        // cout << "Case #" << t << ": ";
        solve();
    }
    //cin.rdbuf()->in_avail()
    return 0;
}

Measured memory_bytes: 3616