#include <bits/stdc++.h>
const int INF = 1000000000;
using namespace std;
vector<long long> v;
vector<pair<long long, long long>> v1, v2;
int main() {
  int n, m, q, p;
  cin >> n >> m >> q >> p;
  vector<vector<int>> vec(n, vector<int>(m, 0));
  char used[250][250];
  vector<pair<int, pair<int, int>>> v;
  string s;
  getline(cin, s);
  for (int i = 0; i < n; i++) {
    getline(cin, s);
    for (int j = 0; j < m; j++) {
      if (s[j] == '*') vec[i][j] = -1;
      if (s[j] == '.') vec[i][j] = 0;
      if (s[j] >= 'A' && s[j] <= 'Z') {
        vec[i][j] = 0;
        v.push_back(make_pair(i, make_pair(j, (s[j] - 'A' + 1) * q)));
      }
    }
  }
  for (int i = 0; i < v.size(); i++) {
    memset(used, 0, sizeof(used));
    queue<pair<int, pair<int, int>>> q1;
    q1.push(make_pair(v[i].first,
                      make_pair(v[i].second.first, v[i].second.second)));
    used[v[i].first][v[i].second.first] = 1;
    vec[v[i].first][v[i].second.first] += v[i].second.second;
    while (!q1.empty()) {
      int x, y, c;
      x = q1.front().first;
      y = q1.front().second.first;
      c = q1.front().second.second;
      if (c == 0) break;
      q1.pop();
      if (x - 1 >= 0 && used[x - 1][y] != 1) {
        if (vec[x - 1][y] == -1)
          used[x - 1][y] = 1;
        else {
          q1.push(make_pair(x - 1, make_pair(y, c / 2)));
          used[x - 1][y] = 1;
          vec[x - 1][y] += c / 2;
        }
      }
      if (x + 1 < n && used[x + 1][y] != 1) {
        if (vec[x + 1][y] == -1)
          used[x + 1][y] = 1;
        else {
          q1.push(make_pair(x + 1, make_pair(y, c / 2)));
          used[x + 1][y] = 1;
          vec[x + 1][y] += c / 2;
        }
      }
      if (y - 1 >= 0 && used[x][y - 1] != 1) {
        if (vec[x][y - 1] == -1)
          used[x][y - 1] = 1;
        else {
          q1.push(make_pair(x, make_pair(y - 1, c / 2)));
          used[x][y - 1] = 1;
          vec[x][y - 1] += c / 2;
        }
      }
      if (y + 1 < m && used[x][y + 1] != 1) {
        if (vec[x][y + 1] == -1)
          used[x][y + 1] = 1;
        else {
          q1.push(make_pair(x, make_pair(y + 1, c / 2)));
          used[x][y + 1] = 1;
          vec[x][y + 1] += c / 2;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (vec[i][j] > p) ans++;
    }
  }
  cout << ans;
  return 0;
}
