#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  int n, m, q, p;
  cin >> n >> m >> q >> p;
  queue<pair<pair<int, int>, int>> qu;
  vector<vector<int>> g(n, vector<int>(m, 0));
  vector<vector<char>> d(n, vector<char>(m));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> d[i][j];
      if (d[i][j] == '*') g[i][j] = -1;
    }
  int si[4]{0, 0, -1, 1};
  int sj[4]{1, -1, 0, 0};
  vector<vector<bool>> used(n, vector<bool>(m, false));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (d[i][j] != '.' && d[i][j] != '*') {
        int cur = (int(d[i][j]) - int('A') + 1) * q;
        g[i][j] += cur;
        qu.push({{i, j}, cur});
        used[i][j] = true;
        while (!qu.empty()) {
          int x = qu.front().first.first;
          int y = qu.front().first.second;
          int qq = qu.front().second;
          for (int c = 0; c < 4; c++) {
            int tx = x + si[c];
            int ty = y + sj[c];
            if (tx > -1 && tx < n && ty > -1 && ty < m)
              if (!used[tx][ty] && g[tx][ty] != -1) {
                g[tx][ty] += qq / 2;
                used[tx][ty] = true;
                if (qq > 1) qu.push({{tx, ty}, qq / 2});
              }
          }
          qu.pop();
        }
        for (int ii = max(i - 28, 0); ii <= min(i + 28, n - 1); ii++)
          for (int jj = max(j - 28, 0); jj <= min(j + 28, m - 1); jj++)
            used[ii][jj] = false;
      }
  int ans = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (g[i][j] > p) ans++;
  cout << ans;
  return 0;
}
