#include <bits/stdc++.h>
using namespace std;
long long n, m, p, q, i, j, k;
long long dx[4] = {0, 1, 0, -1};
long long dy[4] = {1, 0, -1, 0};
string s[251];
long long level[251][251];
long long vis[251][251];
void bfs(long long lv) {
  queue<int> pq;
  pq.push(i);
  pq.push(j);
  vis[i][j] = lv * p;
  level[i][j] += lv * p;
  while (!pq.empty()) {
    long long x = pq.front();
    pq.pop();
    long long y = pq.front();
    pq.pop();
    for (k = 0; k < 4; k++) {
      long long adjx = x + dx[k];
      long long adjy = y + dy[k];
      if (adjx >= 0 && adjy >= 0 && adjx < n && adjy < m &&
          vis[adjx][adjy] == 0 && level[adjx][adjy] != -1) {
        long long d = vis[x][y] / 2;
        vis[adjx][adjy] = d;
        level[adjx][adjy] += d;
        if (d > 0) {
          pq.push(adjx);
          pq.push(adjy);
        }
      }
    }
  }
}
int main() {
  cin >> n >> m >> p >> q;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    for (j = 0; j < m; j++) {
      if (s[i][j] == '*') {
        level[i][j] = -1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
        memset(vis, 0, sizeof(vis));
        bfs(s[i][j] - 64);
      }
    }
  }
  long long c = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (level[i][j] > q) {
        c++;
      }
    }
  }
  cout << c << endl;
  return 0;
}
