#include <bits/stdc++.h>
using namespace std;
const int N = 250 + 5;
int n, m, p, q, vis[N][N];
int dir[4][2] = {0, 1, 0, -1, 1, 0, -1, 0};
char s[N][N];
long long g[N][N];
struct node {
  int x, y;
  long long num;
};
long long c[30];
void init() {
  c[0] = q;
  for (int i = 1; i < 26; ++i) c[i] = c[i - 1] + q;
}
void bfs(int x, int y) {
  memset(vis, 0, sizeof(vis));
  node a, next;
  a.x = x, a.y = y;
  a.num = c[s[x][y] - 'A'];
  queue<node> q;
  q.push(a);
  vis[x][y] = 1;
  while (!q.empty()) {
    a = q.front();
    q.pop();
    g[a.x][a.y] += a.num;
    for (int i = 0; i < 4; ++i) {
      int nx = a.x + dir[i][0];
      int ny = a.y + dir[i][1];
      if (nx < 1 || nx > n || ny < 1 || ny > m) continue;
      if (s[nx][ny] == '*') continue;
      if (vis[nx][ny]) continue;
      next.x = nx, next.y = ny;
      next.num = a.num >> 1;
      if (next.num <= 0) continue;
      q.push(next);
      vis[nx][ny] = 1;
    }
  }
}
int main() {
  while (~scanf("%d%d%d%d", &n, &m, &q, &p)) {
    init();
    for (int i = 1; i <= n; ++i) {
      scanf("%s", s[i] + 1);
    }
    for (int i = 1; i <= n; ++i)
      for (int j = 1; j <= m; ++j)
        if (s[i][j] <= 'Z' && 'A' <= s[i][j]) bfs(i, j);
    int cnt = 0;
    for (int i = 1; i <= n; ++i) {
      for (int j = 1; j <= m; ++j) {
        if (g[i][j] > p) cnt++;
      }
    }
    printf("%d\n", cnt);
  }
  return 0;
}
