import java.io.*;
import java.util.*;

public class virus_va_tl implements Runnable {
	public static void main(String[] args) {
		new Thread(new virus_va_tl()).run();
	}

	BufferedReader br;
	StringTokenizer in;
	PrintWriter out;

	public String nextToken() throws IOException {
		while (in == null || !in.hasMoreTokens()) {
			in = new StringTokenizer(br.readLine());
		}

		return in.nextToken();
	}

	public int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws IOException {
		return Double.parseDouble(nextToken());
	}

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

	public class State {
		int[] x, y;

		public State(int[] xx, int[] yy) {
			x = Arrays.copyOf(xx, xx.length);
			y = Arrays.copyOf(yy, yy.length);
			for (int i = 0; i < x.length; i++) {
				int z = i;
				while (z < x.length - 1
						&& (x[z] > x[z + 1] || (x[z] == x[z + 1] && y[z] > y[z + 1]))) {
					int q = x[z];
					x[z] = x[z + 1];
					x[z + 1] = q;
					q = y[z];
					y[z] = y[z + 1];
					y[z + 1] = q;
					z++;
				}
			}
		}

		public String toString() {
			return "(" + Arrays.toString(x) + " " + Arrays.toString(y) + ")";
		}

		public int hashCode() {
			int hash = 0;
			for (int i = 0; i < x.length; i++) {
				hash = hash * 42 * 97 + (x[i] * 42 + y[i]);
			}
			return hash;
		}

		public boolean equals(Object o) {
			if (o instanceof State) {
				State s = (State) o;
				return Arrays.equals(x, s.x) && Arrays.equals(y, s.y);
			}
			return false;
		}
	}

	HashSet<State> hs = new HashSet<State>();

	int n, m, t;
	int[] x, y;

	boolean[][] touch;
	boolean[][] a;

	public void go(int it) {
		if (it == 0) {
			hs.add(new State(x, y));
			return;
		}

		ArrayList<Integer> backx = new ArrayList<Integer>();
		ArrayList<Integer> backy = new ArrayList<Integer>();

		for (int i = 0; i < dx.length; i++) {
			for (int j = 0; j < x.length - it; j++) {
				int nx = x[j] + dx[i];
				int ny = y[j] + dy[i];

				if (nx < 0 || nx >= n || ny < 0 || ny >= m || a[nx][ny]
						|| touch[nx][ny])
					continue;

				a[nx][ny] = true;
				touch[nx][ny] = true;
				x[x.length - it] = nx;
				y[y.length - it] = ny;

				backx.add(nx);
				backy.add(ny);
				go(it - 1);
				a[nx][ny] = false;
			}
		}

		for (int i = 0; i < backx.size(); i++) {
			touch[backx.get(i)][backy.get(i)] = false;
		}
	}

	public void solve() throws IOException {
		n = nextInt();
		m = nextInt();
		t = nextInt();

		touch = new boolean[n][m];
		a = new boolean[n][m];

		x = new int[8];
		y = new int[8];
		int l = 0;
		for (int i = 0; i < n; i++) {
			char[] c = nextToken().toCharArray();
			for (int j = 0; j < c.length; j++) {
				if (c[j] == '*') {
					x[l] = i;
					y[l++] = j;
					a[i][j] = true;
				}
			}
		}
		x = Arrays.copyOf(x, l + t);
		y = Arrays.copyOf(y, l + t);

		go(t);

		out.println(hs.size());
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("virus.in"));
			out = new PrintWriter("virus.out");

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
