#include <bits/stdc++.h>
using namespace std;
int n, m, q, p;
char mat[255][255];
int dist[255][255], bio[255][255], sol[255][255];
queue<pair<int, int> > qu;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
int pot[31];
int quX[255 * 255], quY[255 * 255], siz, cur;
vector<pair<int, int> > so;
inline bool uvjet(int x, int y) {
  if (x < 0 || y < 0 || x > n - 1 || y > m - 1) return 0;
  return 1;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  pot[0] = 1;
  for (int i = 1; i <= 30; i++) {
    pot[i] = pot[i - 1] * 2;
  }
  int ix = -1, iy = -1;
  cin >> n >> m >> q >> p;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> mat[i][j];
      if (mat[i][j] >= 'A' && mat[i][j] <= 'Z') {
        so.push_back({i, j});
      }
    }
  }
  for (int z = 0; z < so.size(); z++) {
    int x = so[z].first, y = so[z].second;
    memset(bio, 0, sizeof bio);
    memset(dist, 0, sizeof dist);
    cur = 0, siz = 1;
    quX[0] = x, quY[0] = y;
    int broj = mat[x][y] - 'A' + 1;
    broj *= q;
    dist[x][y] = broj;
    sol[x][y] += broj;
    bio[x][y] = 1;
    while (cur < siz) {
      int cx = quX[cur], cy = quY[cur];
      cur++;
      for (int i = 0; i < 4; i++) {
        int nx = cx + dx[i], ny = cy + dy[i];
        if (mat[nx][ny] != '*' && uvjet(nx, ny) && !bio[nx][ny]) {
          dist[nx][ny] = dist[cx][cy] / 2;
          if (dist[nx][ny] == 0) {
            continue;
          }
          sol[nx][ny] += dist[nx][ny];
          quX[siz] = nx, quY[siz] = ny;
          siz++;
          bio[nx][ny] = 1;
        }
      }
    }
  }
  int ksol = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (sol[i][j] > p) {
        ksol++;
      }
    }
  }
  cout << ksol;
  return 0;
}
