#include <bits/stdc++.h>
using namespace std;
const int MAXN = 300;
int n, m, q, p;
char a[MAXN][MAXN];
long long sum[MAXN][MAXN];
int vis[MAXN][MAXN];
int mark = 0;
int qx[MAXN * MAXN];
int qy[MAXN * MAXN];
int qv[MAXN * MAXN];
int head, tail;
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
bool inRange(int x, int y) { return 0 <= x && x < n && 0 <= y && y < m; }
void bfs(int x, int y, int val) {
  head = 0;
  qx[0] = x;
  qy[0] = y;
  qv[0] = val;
  vis[x][y] = mark;
  tail = 1;
  while (head < tail) {
    x = qx[head];
    y = qy[head];
    val = qv[head];
    head++;
    if (val == 0) {
      break;
    }
    sum[x][y] += val;
    for (int z = 0; z < 4; z++) {
      int nx = x + dx[z];
      int ny = y + dy[z];
      if (inRange(nx, ny)) {
        if (vis[nx][ny] == mark) {
          continue;
        }
        if (a[nx][ny] == '*') {
          continue;
        }
        qx[tail] = nx;
        qy[tail] = ny;
        qv[tail] = val / 2;
        vis[nx][ny] = mark;
        tail++;
      }
    }
  }
}
void debug() {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      printf("%d ", int(sum[i][j]));
    }
    puts("");
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &q, &p);
  for (int i = 0; i < n; i++) scanf("%s", a[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if ('A' <= a[i][j] && a[i][j] <= 'Z') {
        int val = (a[i][j] - 'A' + 1) * q;
        mark++;
        bfs(i, j, val);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (sum[i][j] > p) {
        ans++;
      }
    }
  }
  printf("%d\n", ans);
}
