#include <bits/stdc++.h>
using namespace std;
struct pnt {
  int r, s;
  long long tadd;
  pnt(int _r, int _s, long long _tadd) {
    r = _r;
    s = _s;
    tadd = _tadd;
  }
};
const int MAXN = 252;
const int dx[] = {0, 0, -1, 1};
const int dy[] = {-1, 1, 0, 0};
int n, m, p, q, sol = 0;
char mat[MAXN][MAXN];
bool visited[MAXN][MAXN];
long long buka[MAXN][MAXN];
inline bool valid(pnt a) {
  return a.tadd > 0 && a.r >= 0 && a.s >= 0 && a.r < n && a.s < m &&
         mat[a.r][a.s] != '*' && !visited[a.r][a.s];
}
void bfs(pnt start) {
  queue<pnt> to_visit;
  int to_clear = 30;
  while (!((1 << to_clear) && start.tadd)) to_clear--;
  to_clear++;
  for (int i = -to_clear; i <= to_clear; ++i) {
    for (int j = -to_clear; j <= to_clear; ++j) {
      if (start.r + i >= 0 && start.r + i < n && start.s + j >= 0 &&
          start.s + j < m)
        visited[start.r + i][start.s + j] = false;
    }
  }
  visited[start.r][start.s] = true;
  to_visit.push(start);
  while (!to_visit.empty()) {
    pnt curr = to_visit.front();
    buka[curr.r][curr.s] += curr.tadd;
    for (int i = 0; i < 4; ++i) {
      pnt nxt = pnt(curr.r + dx[i], curr.s + dy[i], curr.tadd / 2);
      if (valid(nxt)) {
        to_visit.push(nxt);
        visited[nxt.r][nxt.s] = true;
      }
    }
    to_visit.pop();
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &q, &p);
  for (int i = 0; i < n; ++i) {
    scanf("%s", mat[i]);
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if ('A' <= mat[i][j] && mat[i][j] <= 'Z') {
        bfs(pnt(i, j, (mat[i][j] - 'A' + 1) * q));
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (buka[i][j] > p) sol++;
    }
  }
  printf("%d", sol);
}
