#include <bits/stdc++.h>
using namespace std;
const int way[4][2] = {1, 0, -1, 0, 0, 1, 0, -1};
struct re {
  int x, y, w;
};
queue<re> que;
int n, m, p, q, tim;
int v[310][310], vol[310][310];
char s[310][310];
re get(int x, int y, int w) {
  re rt;
  rt.x = x;
  rt.y = y;
  rt.w = w;
  return rt;
}
void add(int &x, int y) {
  if (x + y > p)
    x = p + 1;
  else
    x += y;
}
bool jd(int x, int y) {
  if (x < 1 || y < 1 || x > n || y > m) return 0;
  if (s[x][y] == '*' || v[x][y] == tim) return 0;
  return 1;
}
void bfs() {
  re t;
  int i, x, y, w;
  while (!que.empty()) {
    t = que.front();
    w = t.w / 2;
    que.pop();
    for (i = 0; i < 4; i++)
      if (jd(x = t.x + way[i][0], y = t.y + way[i][1])) {
        add(vol[x][y], w);
        v[x][y] = tim;
        if (w <= 1) continue;
        que.push(get(x, y, w));
      }
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &q, &p);
  tim = 0;
  for (int i = 1; i <= n; i++) scanf("%s", s[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
        int t = q * (s[i][j] - 'A' + 1);
        v[i][j] = ++tim;
        add(vol[i][j], t);
        if (t <= 1) continue;
        que.push(get(i, j, t));
        bfs();
      }
  int ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (vol[i][j] > p) ans++;
  printf("%d\n", ans);
}
