#include <bits/stdc++.h>
using namespace std;
int n, m, p, q;
long long ans[255][255];
int mx[] = {-1, 0, 1, 0}, my[] = {0, -1, 0, 1};
char s[255][255];
bitset<255> vis[255];
void bfs(int x, int y) {
  for (int i = 0; i < n; i++) vis[i].reset();
  int now = (s[x][y] - 'A' + 1) * q;
  queue<pair<pair<int, int>, int> > Q;
  while (!Q.empty()) Q.pop();
  Q.push(pair<pair<int, int>, int>(pair<int, int>(x, y), now)),
      ans[x][y] += now, vis[x][y] = 1;
  while (!Q.empty()) {
    pair<pair<int, int>, int> p = Q.front();
    Q.pop();
    for (int i = 0; i < 4; i++) {
      int nx = p.first.first + mx[i], ny = p.first.second + my[i];
      if (nx < 0 || nx >= n) continue;
      if (ny < 0 || ny >= m) continue;
      if (s[nx][ny] == '*') continue;
      if (vis[nx][ny]) continue;
      vis[nx][ny] = 1;
      ans[nx][ny] += p.second >> 1;
      if (p.second >> 1)
        Q.push(
            pair<pair<int, int>, int>(pair<int, int>(nx, ny), p.second >> 1));
    }
  }
}
int tot;
int main() {
  scanf("%d %d %d %d ", &n, &m, &q, &p);
  for (int i = 0; i < n; i++) gets(s[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (s[i][j] != '.' && s[i][j] != '*') bfs(i, j);
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (ans[i][j] > p) tot++;
  printf("%d\n", tot);
}
