#include <bits/stdc++.h>
using namespace std;
int X[] = {0, 0, -1, 1};
int Y[] = {-1, 1, 0, 0};
pair<int, int> Q[62505];
int m, n, p, q, res = 0, V[62505], f[255][255], Free[255][255];
char s[255][255];
void BFS(int u, int v, int val, int kk) {
  Free[u][v] = kk;
  f[u][v] += val;
  Q[1] = pair<int, int>(u, v);
  V[1] = val;
  int l = 1, r = 1;
  while (l <= r) {
    u = Q[l].first;
    v = Q[l].second;
    int w = V[l++];
    if (w == 1) continue;
    for (int i = 0; i <= 3; i++) {
      int uu = u + X[i];
      int vv = v + Y[i];
      if (uu > 0 && uu <= m && vv > 0 && vv <= n && s[uu][vv] != '*' &&
          Free[uu][vv] < kk) {
        Free[uu][vv] = kk;
        f[uu][vv] += w / 2;
        Q[++r] = pair<int, int>(uu, vv);
        V[r] = w / 2;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> m >> n >> p >> q;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++) cin >> s[i][j];
  int Count = 0;
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      if ('A' <= s[i][j] && s[i][j] <= 'Z')
        BFS(i, j, p * (s[i][j] - 'A' + 1), ++Count);
  for (int i = 1; i <= m; i++)
    for (int j = 1; j <= n; j++)
      if (f[i][j] > q) res++;
  cout << res;
}
