#include <bits/stdc++.h>
using namespace std;
struct S {
  int x, y, px, py, z;
};
queue<S> Q;
int n, m, q, p;
char a[256][256];
long long val[256][256];
bool vis[256][256];
int dirx[4] = {-1, 0, 1, 0};
int diry[4] = {0, -1, 0, 1};
inline void bfs(int x, int y, int px, int py, int z) {
  if (z == 0) return;
  if (x < 0 || y < 0 || x >= n || y >= m) return;
  if (a[x][y] == '*') return;
  if (vis[x][y]) return;
  vis[x][y] = 1;
  val[x][y] += z;
  for (int i = 0; i < 4; i++) {
    int X = x + dirx[i];
    int Y = y + diry[i];
    if (X == px && Y == py) continue;
    S s;
    s.x = X;
    s.y = Y;
    s.px = x;
    s.py = y;
    s.z = z / 2;
    Q.push(s);
  }
}
inline void bfs(int X, int Y, int Z) {
  S s;
  s.x = X;
  s.y = Y;
  s.px = -1;
  s.py = -1;
  s.z = Z;
  Q.push(s);
  while (Q.size()) {
    s = Q.front();
    Q.pop();
    bfs(s.x, s.y, s.px, s.py, s.z);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> m >> q >> p;
  memset(val, 0, sizeof val);
  vector<pair<int, int> > v;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a[i][j];
      if ('A' <= a[i][j] && a[i][j] <= 'Z') v.push_back(make_pair(i, j));
    }
  }
  for (auto e : v) {
    memset(vis, 0, sizeof vis);
    bfs(e.first, e.second, (a[e.first][e.second] - 'A' + 1) * q);
  }
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (val[i][j] > p) cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
