#include <bits/stdc++.h>
using namespace std;
long long n, m, q, p;
long long dx[] = {0, 0, -1, 1};
long long dy[] = {1, -1, 0, 0};
bool vis[255][255];
int main() {
  cin >> n >> m >> q >> p;
  vector<string> ber(n);
  vector<vector<long long> > noise(n, vector<long long>(m, 0));
  vector<pair<pair<long long, long long>, long long> > starts;
  memset(vis, 0, sizeof(vis));
  for (long long i = (0); i < (n); i++) {
    cin >> ber[i];
    for (long long j = (0); j < (m); j++) {
      long long fac = ber[i][j] - 'A' + 1;
      if (fac >= 1 && fac <= 26) {
        starts.push_back(pair<pair<long long, long long>, long long>(
            pair<long long, long long>(i, j), fac * q));
      }
    }
  }
  vector<pair<long long, long long> > reset;
  for (auto s : starts) {
    for (auto p : reset) {
      vis[p.first][p.second] = false;
    }
    reset.clear();
    queue<pair<pair<long long, long long>, long long> > q;
    vis[s.first.first][s.first.second] = true;
    reset.push_back(s.first);
    q.push(s);
    while (!q.empty()) {
      pair<pair<long long, long long>, long long> x = q.front();
      q.pop();
      noise[x.first.first][x.first.second] += x.second;
      for (long long k = (0); k < (4); k++) {
        long long a = x.first.first + dx[k];
        long long b = x.first.second + dy[k];
        if (a < 0 || a >= n || b < 0 || b >= m) continue;
        if (ber[a][b] == '*') continue;
        if (vis[a][b]) continue;
        if (x.second / 2 == 0) continue;
        vis[a][b] = true;
        reset.push_back(pair<long long, long long>(a, b));
        q.push(pair<pair<long long, long long>, long long>(
            pair<long long, long long>(a, b), x.second / 2));
      }
    }
  }
  long long noisy = 0;
  for (long long i = (0); i < (n); i++) {
    for (long long j = (0); j < (m); j++) {
      if (noise[i][j] > p) noisy++;
    }
  }
  cout << noisy << endl;
}
