#include <bits/stdc++.h>
int n, m, p, q, noise[251][251] = {0}, t[250 * 250 + 1][3];
char a[251][251];
int fx[4][2] = {{1, 0}, {0, 1}, {0, -1}, {-1, 0}};
void bfs(int x, int y, int level) {
  char v[251][251] = {0};
  int i, l, r, nowx, nowy;
  t[0][0] = x;
  t[0][1] = y;
  t[0][2] = level;
  noise[x][y] += level;
  v[x][y] = 1;
  l = 0;
  r = 0;
  while (l <= r) {
    nowx = t[l][0];
    nowy = t[l][1];
    for (i = 0; i < 4; i++) {
      x = nowx + fx[i][0];
      y = nowy + fx[i][1];
      if (x < 0 || x >= n || y < 0 || y >= m) continue;
      if (a[x][y] == '*') continue;
      if (v[x][y] == 1) continue;
      if (t[l][2] <= 1) continue;
      r++;
      t[r][0] = x;
      t[r][1] = y;
      t[r][2] = t[l][2] / 2;
      noise[x][y] += t[r][2];
      v[x][y] = 1;
    }
    l++;
  }
}
int main() {
  int i, j, ans = 0;
  scanf("%d%d%d%d", &n, &m, &q, &p);
  getchar();
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      a[i][j] = getchar();
    }
    getchar();
  }
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      if (a[i][j] <= 'Z' && a[i][j] >= 'A') bfs(i, j, (a[i][j] - 'A' + 1) * q);
    }
  for (i = 0; i < n; i++)
    for (j = 0; j < m; j++) {
      if (noise[i][j] > p) ans++;
    }
  printf("%d\n", ans);
}
