#include <bits/stdc++.h>
using namespace std;
int X[] = {-1, 0, 0, 1}, Y[] = {0, -1, 1, 0};
int n, m;
long long dp[251][251], p, q;
int vis[251][251];
char s[251][251];
long long lvl[251][251];
inline void bfs(int r, int c, long long ams, int num) {
  ams *= q;
  queue<pair<int, int> > Q;
  vis[r][c] = num;
  Q.push(pair<int, int>(r, c));
  lvl[r][c] = ams;
  while (!Q.empty()) {
    auto fr = Q.front();
    Q.pop();
    int x = fr.first;
    int y = fr.second;
    dp[x][y] += lvl[x][y];
    if (!lvl[x][y]) continue;
    for (int i = 0; i < 4; i++) {
      int dx = x + X[i];
      int dy = y + Y[i];
      if (dx >= 0 && dx < n && dy >= 0 && dy < m && vis[dx][dy] != num &&
          s[dx][dy] != '*') {
        vis[dx][dy] = num;
        lvl[dx][dy] = lvl[x][y] / 2ll;
        Q.push(pair<int, int>(dx, dy));
      }
    }
  }
}
int main() {
  scanf("%d %d %lld %lld", &n, &m, &q, &p);
  getchar();
  for (int i = 0; i < n; i++) gets(s[i]);
  int cnt = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (isalpha(s[i][j])) {
        bfs(i, j, s[i][j] - 'A' + 1, cnt);
        cnt++;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (dp[i][j] > p) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
