#include <bits/stdc++.h>
using namespace std;
bool less_vectors(const vector<int>& a, const vector<int>& b) {
  return a.size() > b.size();
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
class compr {
 public:
  bool operator()(pair<pair<int, long long>, int> p1,
                  pair<pair<int, long long>, int> p2) {
    if (p1.first.second != p2.first.second)
      return p1.first.second > p2.first.second;
    else if (p1.second != p2.second)
      return p1.second > p2.second;
    else
      return p1.first < p2.first;
  }
};
long long fastexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1)
      res = (((res) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    a = (((a) % 1000000007) * ((a) % 1000000007)) % 1000000007;
    b /= 2;
  }
  return res;
}
long long fastexpom(long long a, long long b, long long m) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1) res = (((res) % m) * ((a) % m)) % m;
    a = (((a) % m) * ((a) % m)) % m;
    b /= 2;
  }
  return res;
}
long long modinv(long long a, long long m = 1000000007) {
  return fastexpom(a, m - 2, m);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n, m, q, p;
  cin >> n >> m >> q >> p;
  vector<vector<char> > v(n, vector<char>(m, 0));
  vector<vector<long long> > noise(n, vector<long long>(m, 0));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) cin >> v[i][j];
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v[i][j] >= 65 && v[i][j] <= 90) {
        long long st = (v[i][j] - 64) * q;
        vector<vector<int> > vis(n, vector<int>(m, 0));
        queue<pair<pair<int, int>, long long> > q;
        q.push(make_pair(make_pair(i, j), st));
        vis[i][j] = 1;
        while (!q.empty()) {
          pair<pair<int, int>, long long> p = q.front();
          q.pop();
          int a = p.first.first;
          int b = p.first.second;
          if (a < 0 || a > n - 1 || b < 0 || b > m - 1 || p.second == 0)
            continue;
          if (v[a][b] == '*') continue;
          noise[a][b] += p.second;
          if (a + 1 < n && !vis[a + 1][b]) {
            vis[a + 1][b] = 1;
            q.push(make_pair(make_pair(a + 1, b), p.second / 2));
          }
          if (a - 1 > -1 && !vis[a - 1][b]) {
            vis[a - 1][b] = 1;
            q.push(make_pair(make_pair(a - 1, b), p.second / 2));
          }
          if (b - 1 > -1 && !vis[a][b - 1]) {
            vis[a][b - 1] = 1;
            q.push(make_pair(make_pair(a, b - 1), p.second / 2));
          }
          if (b + 1 < m && !vis[a][b + 1]) {
            vis[a][b + 1] = 1;
            q.push(make_pair(make_pair(a, b + 1), p.second / 2));
          }
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (noise[i][j] > p) ans++;
    }
  }
  cout << ans;
  return 0;
}
