#include <bits/stdc++.h>
using namespace std;
int dd[4][2] = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}};
int n, m, q, k, ss;
struct source {
  int x, y, k;
} b[255 * 255];
char a[255][255];
int ans[255][255];
pair<int, int> c[255 * 255];
int d[255][255];
void init() {
  int i, j;
  scanf("%d%d%d%d", &n, &m, &q, &k);
  getchar();
  for (i = (1); i <= (n); i++) {
    scanf("%s", a[i] + 1);
    for (j = (1); j <= (m); j++)
      if (a[i][j] >= 'A' && a[i][j] <= 'Z') {
        ss++;
        b[ss].x = i;
        b[ss].y = j;
        b[ss].k = a[i][j] - 'A' + 1;
        a[i][j] = '.';
      }
  }
  for (j = (0); j <= (m + 1); j++) a[0][j] = '*';
  for (j = (0); j <= (m + 1); j++) a[n + 1][j] = '*';
  for (i = (0); i <= (n + 1); i++) a[i][0] = '*';
  for (i = (0); i <= (n + 1); i++) a[i][m + 1] = '*';
}
void work() {
  int i, j, h, t, x, y, tx, ty;
  for (i = (1); i <= (ss); i++) {
    h = 0;
    t = 1;
    memset(d, 0, sizeof(d));
    c[1] = make_pair(b[i].x, b[i].y);
    d[b[i].x][b[i].y] = 1;
    while (h < t) {
      h++;
      x = c[h].first;
      y = c[h].second;
      if (i * q / (1 << (d[x][y] - 1)) == 0) continue;
      if (ans[x][y] <= k) ans[x][y] += b[i].k * q / (1 << (d[x][y] - 1));
      for (j = (0); j <= (3); j++) {
        tx = x + dd[j][0];
        ty = y + dd[j][1];
        if (a[tx][ty] == '*' || d[tx][ty]) continue;
        t++;
        c[t] = make_pair(tx, ty);
        d[tx][ty] = d[x][y] + 1;
      }
    }
  }
  int anss = 0;
  for (i = (1); i <= (n); i++)
    for (j = (1); j <= (m); j++)
      if (ans[i][j] > k) anss++;
  printf("%d\n", anss);
}
int main() {
  init();
  work();
  return 0;
}
