#include <bits/stdc++.h>
using namespace std;
char polje[300][300];
int bio[300][300], koraci[300][300], n, m, k, limit;
int kX[4] = {0, 0, -1, 1}, kY[4] = {1, -1, 0, 0}, sol;
void bfs(int prvi, int drugi, int broj) {
  queue<pair<pair<int, int>, int> > p;
  bio[prvi][drugi] = 1;
  p.push(make_pair(make_pair(prvi, drugi), broj * k));
  int x, y, glasnoca;
  while (!p.empty()) {
    x = p.front().first.first;
    y = p.front().first.second;
    glasnoca = p.front().second;
    p.pop();
    koraci[x][y] += glasnoca;
    for (int r = 0; r < (4); ++r) {
      if (x + kX[r] >= 0 && x + kX[r] < n && y + kY[r] < m && y + kY[r] >= 0 &&
          glasnoca >= 1 && polje[x + kX[r]][y + kY[r]] != '*' &&
          !bio[x + kX[r]][y + kY[r]]) {
        p.push(make_pair(make_pair(x + kX[r], y + kY[r]), (glasnoca / 2)));
        bio[x + kX[r]][y + kY[r]] = 1;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  scanf("%d", &m);
  scanf("%d", &k);
  scanf("%d", &limit);
  for (int i = 0; i < (n); ++i) scanf("%s", polje[i]);
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      if (polje[i][j] >= 'A' && polje[i][j] <= 'Z') {
        memset(bio, 0, sizeof(bio));
        bfs(i, j, (polje[i][j] - 'A' + 1));
      }
    }
  }
  for (int i = 0; i < (n); ++i) {
    for (int j = 0; j < (m); ++j) {
      if (koraci[i][j] > limit) sol++;
    }
  }
  printf("%d\n", sol);
  return 0;
}
