import java.io.*; import java.util.*; import java.util.stream.*; public class Main { static int[][][] sums; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); int h = sc.nextInt(); int w = sc.nextInt(); int kk = sc.nextInt(); char[][] field = new char[h][]; for (int i = 0; i < h; i++) { field[i] = sc.next().toCharArray(); } int[][][] levels = new int[h + 1][w + 1][27]; for (int[] arr : levels[h]) { Arrays.fill(arr, 1); } for (int i = h - 1; i >= 0; i--) { Arrays.fill(levels[i][w], 1); for (int j = w - 1; j >= 0; j--) { for (int k = 0; k < 27; k++) { levels[i][j][k] = Math.min(Math.min(levels[i + 1][j][k], levels[i][j + 1][k]), levels[i + 1][j + 1][k]) + 1; } levels[i][j][field[i][j] - 'a'] = 1; } } long ans = 0; for (int i = 0; i < h; i++) { for (int j = 0; j < w; j++) { Arrays.sort(levels[i][j]); ans += levels[i][j][kk] - levels[i][j][kk - 1]; } } System.out.println(ans); } } class Utilities { static String arrayToLineString(Object[] arr) { return Arrays.stream(arr).map(x -> x.toString()).collect(Collectors.joining("\n")); } static String arrayToLineString(int[] arr) { return String.join("\n", Arrays.stream(arr).mapToObj(String::valueOf).toArray(String[]::new)); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); StringBuilder sb = new StringBuilder(); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public int[] nextIntArray() throws Exception { return Stream.of(br.readLine().split(" ")).mapToInt(Integer::parseInt).toArray(); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }