#include <bits/stdc++.h>
using namespace std;
const int N = 300, M = N * N;
int dis[N][N], pows[N];
char str[N][N];
long long va[N][N];
int n, m, w, p;
pair<int, int> q[M];
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};
void bfs(int stx, int sty) {
  int tt = -1, hh = 0;
  q[++tt] = {stx, sty};
  dis[stx][sty] = w * (str[stx][sty] - 'A' + 1);
  while (tt >= hh) {
    pair<int, int> t = q[hh++];
    int x = t.first, y = t.second;
    if (dis[x][y] == 1) continue;
    for (int i = 0; i < 4; i++) {
      int f = x + dx[i], s = y + dy[i];
      if (f < 1 || f > n || s < 1 || s > m) continue;
      if (dis[f][s] || str[f][s] == '*') continue;
      dis[f][s] = dis[x][y] / 2;
      q[++tt] = {f, s};
    }
  }
  for (int i = 0; i <= tt; i++)
    va[q[i].first][q[i].second] += dis[q[i].first][q[i].second],
        dis[q[i].first][q[i].second] = 0;
}
int main() {
  pows[0] = 1;
  for (int i = 1; i <= 25; i++) {
    pows[i] = pows[i - 1] * 2;
  }
  scanf("%d %d %d %d", &n, &m, &w, &p);
  for (int i = 1; i <= n; i++) scanf("%s", str[i] + 1);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (str[i][j] >= 'A' && str[i][j] <= 'Z') bfs(i, j);
  int cnt = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= m; j++)
      if (va[i][j] > p) cnt++;
  printf("%d ", cnt);
  return 0;
}
