#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 255;
long long n, m, q, p;
char a[MAXN][MAXN];
bool vis[MAXN][MAXN];
long long ans[MAXN][MAXN];
long long level[MAXN][MAXN];
long long dx[] = {0, 0, -1, 1};
long long dy[] = {-1, 1, 0, 0};
queue<pair<long long, long long>> qe;
bool check(long long i, long long j) {
  if (i < 0 or i > n - 1 or j < 0 or j > m - 1 or a[i][j] == '*' or vis[i][j])
    return false;
  return true;
}
void bfs() {
  while (!qe.empty()) {
    pair<long long, long long> temp1 = qe.front();
    qe.pop();
    if (level[temp1.first][temp1.second] == 0) continue;
    for (long long i = 0; i < 4; i++) {
      long long row = temp1.first + dx[i];
      long long column = temp1.second + dy[i];
      if (check(row, column)) {
        level[row][column] = level[temp1.first][temp1.second] / 2;
        ans[row][column] += level[row][column];
        vis[row][column] = true;
        qe.push(make_pair(row, column));
      }
    }
  }
}
int main() {
  cin >> n >> m >> q >> p;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++) cin >> a[i][j];
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++)
      if (a[i][j] != '.' and a[i][j] != '*') {
        memset(vis, false, sizeof vis);
        long long value = (a[i][j] - 'A' + 1) * q;
        ans[i][j] += value;
        vis[i][j] = true;
        level[i][j] = value;
        while (!qe.empty()) qe.pop();
        qe.push(make_pair(i, j));
        bfs();
      }
  long long answer = 0;
  for (long long i = 0; i < n; i++)
    for (long long j = 0; j < m; j++)
      if (ans[i][j] > p) answer++;
  cout << answer;
  return 0;
}
