#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1600000000000000000LL;
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int dx4[] = {0, 0, 1, -1};
const int dy4[] = {1, -1, 0, 0};
const int N = 255;
long long int sum[N][N];
vector<pair<int, int> > pos;
int n, m, q, p;
string s[N];
int vis[N][N];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> m >> q >> p;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    for (int j = 0; j < m; j++) {
      if (s[i][j] != '.' and s[i][j] != '*') {
        pos.push_back(make_pair(i, j));
      }
    }
  }
  int sz = pos.size();
  for (int i = 0; i < sz; i++) {
    int x = pos[i].first;
    int y = pos[i].second;
    char c = s[x][y];
    int ff = c - 'A' + 1;
    long long int K = ff * 1LL * q;
    int rVis = i + 1;
    vis[x][y] = rVis;
    ;
    sum[x][y] += K;
    queue<pair<int, pair<int, int> > > q;
    q.push(make_pair(-K, make_pair(x, y)));
    while (!q.empty()) {
      auto qq = q.front();
      q.pop();
      int cX = qq.second.first;
      int cY = qq.second.second;
      int val = -1 * qq.first;
      for (int i = 0; i < 4; i++) {
        int nX = dx4[i] + cX;
        int nY = dy4[i] + cY;
        if (nX >= 0 and nX < n and nY >= 0 and nY < m and vis[nX][nY] < rVis and
            s[nX][nY] != '*') {
          vis[nX][nY] = rVis;
          sum[nX][nY] += val / 2;
          if (val / 2 > 0) q.push(make_pair(-1 * val / 2, make_pair(nX, nY)));
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (s[i][j] == '*') continue;
      if (sum[i][j] > p) ans++;
    }
  }
  cout << ans;
}
