#include <bits/stdc++.h>
using namespace std;
const int dx[4] = {0, 1, 0, -1};
const int dy[4] = {1, 0, -1, 0};
int n, m, timer = 0, power, lim;
char a[255][255];
int vis[255][255];
long long noise[255][255];
long long pre[255][255];
void bfs(long long x, long long y) {
  timer++;
  queue<pair<long long int, long long int> > q;
  q.push({x, y});
  vis[x][y] = timer;
  pre[x][y] = power * (a[x][y] - 'A' + 1);
  while (!q.empty()) {
    pair<long long int, long long int> cur = q.front();
    q.pop();
    noise[cur.first][cur.second] += pre[cur.first][cur.second];
    if (pre[cur.first][cur.second] >= 2) {
      for (long long int i = 0; i < 4; i++) {
        long long xn = cur.first + dx[i];
        long long yn = cur.second + dy[i];
        if (xn >= 0 && yn >= 0 && xn < n && yn < m) {
          if (vis[xn][yn] != timer && a[xn][yn] != '*') {
            q.push({xn, yn});
            vis[xn][yn] = timer;
            pre[xn][yn] = pre[cur.first][cur.second] >> 1;
          }
        }
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    cin >> n >> m >> power >> lim;
    for (long long int i = 0; i < n; i++)
      for (long long int j = 0; j < m; j++) cin >> a[i][j];
    for (long long int i = 0; i < n; i++)
      for (long long int j = 0; j < m; j++)
        if (a[i][j] >= 'A' && a[i][j] <= 'Z') bfs(i, j);
    long long ans = 0;
    for (long long int i = 0; i < n; i++)
      for (long long int j = 0; j < m; j++)
        if (noise[i][j] > lim) ans++;
    cout << ans;
  }
  return 0;
}
