#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f, N = 255;
inline int read() {
  int sum = 0, f = 1;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (c >= '0' && c <= '9') sum = sum * 10 + c - 48, c = getchar();
  return sum * f;
}
const int dir[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
int n, m, Q, p;
long long noise[N][N];
char s[N][N];
bool vis[N][N];
struct node {
  int x, y, step;
};
void bfs(int x, int y, int t) {
  memset(vis, 0, sizeof(vis));
  queue<node> q;
  q.push({x, y, 0});
  vis[x][y] = 1;
  noise[x][y] += t * Q;
  while (!q.empty()) {
    int nowx = q.front().x, nowy = q.front().y, step = q.front().step;
    if (t * Q / (1ll << step) == 0) break;
    q.pop();
    for (int i = 0; i < 4; i++) {
      int tx = nowx + dir[i][0], ty = nowy + dir[i][1];
      if (tx <= 0 || tx > n || ty <= 0 || ty > m || vis[tx][ty] ||
          s[tx][ty] == '*')
        continue;
      vis[tx][ty] = 1;
      q.push({tx, ty, step + 1});
      noise[tx][ty] += t * Q / (1ll << (step + 1));
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> m >> Q >> p;
  for (int i = 1; i <= n; i++) cin >> (s[i] + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
        bfs(i, j, s[i][j] - 'A' + 1);
        for (int i = 1; i <= n; i++)
          for (int j = 1; j <= m; j++)
            ;
      }
    }
  }
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++) cnt += (s[i][j] != '*' && noise[i][j] > p);
  cout << cnt << '\n';
  return 0;
}
