#include <bits/stdc++.h>
using namespace std;
const int maxn = 250 + 10;
int n, m;
long long p, q;
char s[maxn][maxn];
long long value[maxn][maxn];
long long sum[maxn][maxn];
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
void bfs(int I, int J) {
  memset(value, 0, sizeof(value));
  queue<pair<int, int> > Q;
  value[I][J] = q * (s[I][J] - 'A' + 1);
  sum[I][J] += value[I][J];
  Q.push({I, J});
  while (!Q.empty()) {
    int x = Q.front().first;
    int y = Q.front().second;
    Q.pop();
    for (int k = 0; k < 4; ++k) {
      int i = x + dx[k];
      int j = y + dy[k];
      if (i < 0 || i >= n || j < 0 || j >= m || value[i][j] || s[i][j] == '*')
        continue;
      value[i][j] = value[x][y] / 2;
      sum[i][j] += value[i][j];
      if (value[i][j]) Q.push({i, j});
    }
  }
}
int solve() {
  int ans = 0;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if ('A' <= s[i][j] && s[i][j] <= 'Z') bfs(i, j);
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j)
      if (sum[i][j] > p) ++ans;
  return ans;
}
int main() {
  scanf("%d %d %lld %lld", &n, &m, &q, &p);
  for (int i = 0; i < n; ++i) scanf(" %s", s[i]);
  printf("%d\n", solve());
  return 0;
}
