#include <bits/stdc++.h>
using namespace std;
const int N = 250 + 4;
struct cell {
  int y, x, ph;
  cell(int yy = 0, int xx = 0, int phh = 0) {
    y = yy;
    x = xx;
    ph = phh;
  }
};
int n, m, p, q, usedFlag;
int used[N][N], phTab[N][N];
string tab[N];
void read() {
  cin >> n >> m >> q >> p;
  for (int i = 0; i < n; ++i) {
    cin >> tab[i];
  }
}
queue<cell> qbfs;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
void bfs() {
  while (qbfs.size()) {
    cell top = qbfs.front();
    qbfs.pop();
    phTab[top.y][top.x] += top.ph;
    int newPh = top.ph / 2;
    for (int i = 0; i < 4 && newPh; ++i) {
      int x = top.x + dx[i];
      int y = top.y + dy[i];
      if (x < 0 || y < 0 || x == m || y == n || used[y][x] == usedFlag ||
          tab[y][x] == '*') {
        continue;
      }
      used[y][x] = usedFlag;
      qbfs.push(cell(y, x, newPh));
    }
  }
}
void precalc() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (tab[i][j] == '.' || tab[i][j] == '*') {
        continue;
      }
      qbfs.push(cell(i, j, q * (tab[i][j] - 'A' + 1)));
      usedFlag = i * 256 + j + 1;
      used[i][j] = usedFlag;
      bfs();
    }
  }
}
int ans = 0;
void calc() {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      ans += (phTab[i][j] > p);
    }
  }
}
void solve() {
  read();
  precalc();
  calc();
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  solve();
  return 0;
}
