#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
char grid[260][260];
long long grid2[260][260];
long long n, m;
long long lv[260][260];
long long vis[260][260];
void BFS(long long srcx, long long srcy, long long k) {
  long long i, j, ad, u;
  int mask = (srcx + 1) * (m + 1) + srcy + 1;
  deque<pair<long long, long long> > dq;
  lv[srcx][srcy] = 0;
  grid2[srcx][srcy] += k;
  vis[srcx][srcy] = mask;
  dq.push_back(pair<long long, long long>(srcx, srcy));
  while (!dq.empty()) {
    pair<long long, long long> u = dq[0];
    dq.pop_front();
    for (i = 0; i < 4; i++) {
      long long nx = u.first + dx[i];
      long long ny = u.second + dy[i];
      if (grid[nx][ny] == '*' || nx < 0 || nx >= n || ny < 0 || ny >= m)
        continue;
      if (vis[nx][ny] != mask) {
        lv[nx][ny] = lv[u.first][u.second] + 1;
        long long vag = (1LL << lv[nx][ny]);
        vis[nx][ny] = mask;
        if (k >= vag) {
          grid2[nx][ny] += k / vag;
          dq.push_back(pair<long long, long long>(nx, ny));
        }
      }
    }
  }
}
int main() {
  long long cs, t, i, j, k, x, y, z, ans, q, p;
  for (cs = 1; scanf("%lld", &n) != EOF; cs++) {
    scanf("%lld", &m);
    scanf("%lld", &q);
    scanf("%lld", &p);
    for (i = 0; i < n; i++) {
      scanf("%s", grid[i]);
    }
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) {
        if (grid[i][j] != '.' && grid[i][j] != '*') {
          BFS(i, j, (grid[i][j] - 'A' + 1) * q);
        }
      }
    ans = 0;
    for (i = 0; i < n; i++)
      for (j = 0; j < m; j++) {
        if (grid2[i][j] > p) ans++;
      }
    printf("%lld\n", ans);
  }
  return 0;
}
