#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
long long sum[300][300];
string s[300];
long long n, m, q, p;
long long bfs(int x, int y, long long v, int c) {
  sum[x][y] += v;
  long long vis[300][300], level[300][300];
  vis[x][y] = c;
  level[x][y] = 1;
  queue<pair<int, int> > qq;
  qq.push(pair<int, int>(x, y));
  while (!qq.empty()) {
    pair<int, int> top = qq.front();
    qq.pop();
    int xx = top.first, yy = top.second;
    for (int k = 0; k < 4; k++) {
      int tx = xx + dx[k];
      int ty = yy + dy[k];
      if (tx < 0 or tx >= n or ty < 0 or ty >= m) continue;
      if (vis[tx][ty] == c or s[tx][ty] == '*') continue;
      if (level[xx][yy] * 2 > v) continue;
      level[tx][ty] = level[xx][yy] * 2;
      vis[tx][ty] = c;
      sum[tx][ty] += v / level[tx][ty];
      qq.push(pair<int, int>(tx, ty));
    }
  }
}
int main() {
  cin >> n >> m >> q >> p;
  string ss = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  for (int i = 0; i < n; i++) cin >> s[i];
  int c = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '.' or s[i][j] == '*') continue;
      int k;
      for (k = 0; k < 26; k++) {
        if (s[i][j] == ss[k]) break;
      }
      long long vv = (k + 1) * q;
      bfs(i, j, vv, c);
      c++;
    }
  }
  int count = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (sum[i][j] > p) count++;
    }
  }
  cout << count << endl;
}
