#include <bits/stdc++.h>
using namespace std;
struct node {
  int x, y, step;
  node(int x, int y, int step) : x(x), y(y), step(step){};
};
int n, m, nq, np;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int sum[255][255];
bool vis[255][255];
char m_map[255][255];
void BFS(int From, int To) {
  memset(vis, false, sizeof(vis));
  queue<node> q;
  vis[From][To] = true;
  int temp = ((m_map[From][To] - 'A') + 1) * nq;
  q.push(node(From, To, temp));
  while (!q.empty()) {
    node p = q.front();
    q.pop();
    if (p.step <= 0) continue;
    for (int i = 0; i < 4; i++) {
      int mx = p.x + dx[i], my = p.y + dy[i];
      if (mx < 0 || mx >= n || my < 0 || my >= m || vis[mx][my] ||
          m_map[mx][my] == '*')
        continue;
      vis[mx][my] = true;
      sum[mx][my] += p.step / 2;
      q.push(node(mx, my, p.step / 2));
    }
  }
  sum[From][To] += temp;
}
void Solve() {
  int cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (sum[i][j] > np) cnt++;
  cout << cnt << endl;
}
int main() {
  scanf("%d%d%d%d", &n, &m, &nq, &np);
  for (int i = 0; i < n; i++) scanf("%s", m_map[i]);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (m_map[i][j] == '*') sum[i][j] = 0;
      if (m_map[i][j] >= 'A' && m_map[i][j] <= 'Z') BFS(i, j);
    }
  }
  Solve();
}
