//#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <ctime>
#include <algorithm>
#include <sstream>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <cstdlib>
#include <cstdio>
#include <iterator>
#include <functional>
#include <bitset>
#define mp make_pair
#define pb push_back

#ifdef LOCAL
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#else
#define eprintf(...)
#endif

#define TIMESTAMP(x) eprintf("["#x"] Time : %.3lf s.\n", clock()*1.0/CLOCKS_PER_SEC)
#define TIMESTAMPf(x,...) eprintf("[" x "] Time : %.3lf s.\n", __VA_ARGS__, clock()*1.0/CLOCKS_PER_SEC)

#if ( _WIN32 || __WIN32__ )
    #define LLD "%I64d"
#else
    #define LLD "%lld"
#endif

using namespace std;

#define TASKNAME "virus"

#ifdef LOCAL
static struct __timestamper {
	~__timestamper(){
        TIMESTAMP(end);
	}
} __TIMESTAMPER;
#endif

typedef long long ll;
typedef long double ld;

const int MAXN = 110;

const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};

int can[MAXN][MAXN];
bool used[MAXN][MAXN];

int qx[MAXN*MAXN];
int qy[MAXN*MAXN];
int qh, qt;
int n,m,t;

void use(int x,int y){
    used[x][y] = true;
    for (int i = 0; i < 4; i++){
    	int nx = x + dx[i];
    	int ny = y + dy[i];
    	if (0 <= nx && nx < n && 0 <= ny && ny < m && can[nx][ny] == -1){
    	    can[nx][ny] = x * m + y;
    	    qx[qt] = nx;
    	    qy[qt] = ny;
    	    qt++;
    	}
    }
}

void unuse(int x,int y){
    used[x][y] = false;
    for (int i = 0; i < 4; i++){
    	int nx = x + dx[i];
    	int ny = y + dy[i];
    	if (0 <= nx && nx < n && 0 <= ny && ny < m && can[nx][ny] == x*m+y){
    	    can[nx][ny] = -1;
    	}
    }
}

int ans;

void go(int cnt){
    if (cnt == t){
    	ans++;
    	return;
    }
    if (qh == qt) return;
    if (!used[qx[qh]][qy[qh]]){
    	int oldt = qt;
        use(qx[qh], qy[qh]);
        qh++;
        go(cnt+1);
        qh--;
        unuse(qx[qh], qy[qh]);
        qt = oldt;
    }
    qh++;
    go(cnt);
    qh--;
}



int main(){
  freopen(TASKNAME".in","r",stdin);
  freopen(TASKNAME".out","w",stdout);
  scanf("%d%d%d",&n,&m,&t);

  memset(can, -1, sizeof(can));

  for (int i = 0; i < n; i++)
  	for (int j = 0; j < m; j++){
  		char c;
  		scanf(" %c",&c);
  		if (c == '*')
  		   can[i][j] = -2;
  	}

  for (int i = 0; i < n; i++)
  	for (int j = 0; j < m; j++)
  		if (can[i][j] == -2)
  		   use(i, j);

  go(0);

  printf("%d\n", ans);
      
  return 0;
}