#include <bits/stdc++.h>
using namespace std;
char s[300][300];
struct node {
  int x, y;
  int p;
};
int n, m;
int data[300][300];
bool vis[300][300];
int dict[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
bool judge(int x, int y) {
  if (x < 0 || x >= n || y < 0 || y >= m) return false;
  return true;
}
void bfs(int x, int y, int noice) {
  int op;
  memset(vis, false, sizeof(vis));
  queue<node> q;
  node t = (node){x, y, noice};
  vis[x][y] = true;
  q.push(t);
  while (!q.empty()) {
    node v = q.front();
    q.pop();
    data[v.x][v.y] += v.p;
    int pp = v.p / 2;
    if (!pp) continue;
    for (int i = 0; i < 4; i++) {
      t.x = v.x + dict[i][0];
      t.y = v.y + dict[i][1];
      if (judge(t.x, t.y) && !vis[t.x][t.y] && s[t.x][t.y] != '*') {
        t.p = pp;
        q.push(t);
        vis[t.x][t.y] = true;
      }
    }
  }
}
int main() {
  int i, j;
  int p, q;
  while (~scanf("%d %d %d %d", &n, &m, &q, &p)) {
    memset(data, 0, sizeof(data));
    for (i = 0; i < n; i++) {
      scanf("%s", s[i]);
    }
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
          bfs(i, j, (s[i][j] - 'A' + 1) * q);
        }
      }
    }
    int num = 0;
    for (i = 0; i < n; i++) {
      for (j = 0; j < m; j++) {
        if (data[i][j] > p) num++;
      }
    }
    printf("%d\n", num);
  }
}
