import ru.ifmo.validate.*;

public class Validate implements Validator {
	int MAXN = 100;
	int MAXT = 6;
	int MAXK = 8;

	public void validate(ValidatingScanner inf) {
		int n = inf.nextInt(1, MAXN);
		int m = inf.nextInt(1, MAXN);
		int t = inf.nextInt(1, MAXT);
		inf.eoln();

		int cnt = 0;
		for (int i = 0; i < n; i++) {
			String s = inf.next(".*", m);

			for (int j = 0; j < m; j++) {
				if (s.charAt(j) == '*')
					cnt++;
			}

			inf.eoln();
		}

		if (cnt > MAXK) {
			throw new RuntimeException(
					"The amount of viruses is too damn high! We have " + cnt
							+ " viruses.");
		}

		if (n * m < cnt + t) {
			throw new RuntimeException("The amount of viruses after time t is bigger, than the table size.");
		}
	}
}
