#include <bits/stdc++.h>
using namespace std;
struct pos {
  int x, y, w;
};
queue<pos> que;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
char a[256][256];
int level[256][256];
bool b[256][256];
int n, m, q, p, ans = 0;
void BFS(int sx, int sy, int sw) {
  memset(b, 0, sizeof b);
  que.push({sx, sy, sw});
  b[sx][sy] = 1;
  level[sx][sy] += sw;
  while (!que.empty()) {
    int x = que.front().x, y = que.front().y;
    if (que.front().w != 0)
      for (int k = 0; k <= 3; ++k)
        if (b[x + dx[k]][y + dy[k]] == 0)
          if (a[x + dx[k]][y + dy[k]] != '*') {
            level[x + dx[k]][y + dy[k]] += que.front().w / 2;
            b[x + dx[k]][y + dy[k]] = 1;
            que.push({x + dx[k], y + dy[k], que.front().w / 2});
          }
    que.pop();
  }
}
int main() {
  memset(a, '*', sizeof a);
  cin >> n >> m >> q >> p;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j) cin >> a[i][j];
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if ('A' <= a[i][j] && a[i][j] <= 'Z') BFS(i, j, q * (a[i][j] - 'A' + 1));
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= m; ++j)
      if (level[i][j] > p) ++ans;
  return cout << ans << endl, 0;
}
