#include <bits/stdc++.h>
using namespace std;
inline void in(int &a) { scanf("%d", &a); }
int getU() {
  int num = getchar();
  int angka = 0;
  bool neg = false;
  if (num == '-') {
    neg = true;
    num = getchar();
  }
  for (; num <= '9' && num >= '0'; num = getchar()) {
    angka *= 10;
    angka += num - '0';
  }
  if (neg)
    return -1 * angka;
  else
    return angka;
}
long long ans[253][253];
bool visited[253][253];
int dr[] = {1, 0, -1, 0}, dc[] = {0, 1, 0, -1};
int n, m, q, p;
char board[253][253];
bool inside(int r, int c) { return 0 <= r && r < n && 0 <= c && c < m; }
void bfs(int r, int c, int nu) {
  memset(visited, 0, sizeof(visited));
  queue<pair<pair<int, int>, int> > q;
  q.push(make_pair(make_pair(r, c), nu));
  visited[r][c] = 1;
  while (!q.empty()) {
    pair<pair<int, int>, int> u = q.front();
    q.pop();
    ans[u.first.first][u.first.second] += 1LL * u.second;
    for (int i = 0; i < 4; i++) {
      int x = u.first.first + dr[i], y = u.first.second + dc[i];
      if (inside(x, y) && !visited[x][y] && board[x][y] != '*' &&
          u.second / 2 > 0) {
        visited[x][y] = 1;
        q.push(make_pair(make_pair(x, y), u.second / 2));
      }
    }
  }
}
int main() {
  n = getU();
  m = getU();
  q = getU();
  p = getU();
  for (int i = 0; i < n; i++) {
    scanf("%s", board[i]);
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (board[i][j] != '*' && board[i][j] != '.') {
        bfs(i, j, (board[i][j] - 'A' + 1) * q);
      }
    }
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (ans[i][j] > p) cnt++;
    }
  }
  printf("%d\n", cnt);
  return 0;
}
