#include <bits/stdc++.h>
using namespace std;
const int kMaxN = 250;
const int kMaxSources = 65000;
int n, m, p, q;
bool M[kMaxN][kMaxN];
int used[kMaxN][kMaxN];
long long sum[kMaxN][kMaxN];
vector<tuple<int, int, int> > sources;
int move_x[] = {0, 0, -1, 1};
int move_y[] = {-1, 1, 0, 0};
void bfs(int index, int x, int y, int s) {
  queue<tuple<int, int, int> > Q;
  Q.push(make_tuple(x, y, s));
  used[x][y] = index;
  sum[x][y] += s;
  while (!Q.empty()) {
    int ax, ay, as;
    tie(ax, ay, as) = Q.front();
    Q.pop();
    as /= 2;
    if (as == 0) continue;
    for (int i = 0; i < 4; ++i) {
      int nx = ax + move_x[i];
      int ny = ay + move_y[i];
      if (nx < 0 || nx >= n) continue;
      if (ny < 0 || ny >= m) continue;
      if (M[nx][ny]) continue;
      if (used[nx][ny] < index) {
        Q.push(make_tuple(nx, ny, as));
        used[nx][ny] = index;
        sum[nx][ny] += as;
      }
    }
  }
}
int main() {
  cin >> n >> m >> q >> p;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    for (int j = 0; j < m; ++j) {
      char c = s[j];
      if (c == '*')
        M[i][j] = true;
      else if (c != '.') {
        sources.push_back(make_tuple(i, j, (c - 'A' + 1) * q));
      }
    }
  }
  for (int i = 0; i < sources.size(); ++i) {
    int x, y, s;
    tie(x, y, s) = sources[i];
    bfs(i + 1, x, y, s);
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (sum[i][j] > p) ++ans;
    }
  }
  cout << ans << '\n';
  return 0;
}
