#include <bits/stdc++.h>
using namespace std;
template <class T>
istream& operator>>(istream& stream, vector<T>& v) {
  for (T& x : v) {
    stream >> x;
  }
  return stream;
}
const int inf = 1000000000 + 7;
char d[300][300];
int was[300][300];
int ans[300][300];
int dx[4] = {-1, 1, 0, 0};
int dy[4] = {0, 0, 1, -1};
int n, m;
int w = 1;
int mnog;
void bfs(int i, int j, int u) {
  was[i][j] = w;
  ans[i][j] += u * mnog;
  queue<pair<int, int>> q;
  queue<int> qq;
  q.push({i, j});
  qq.push(u * mnog);
  while (!q.empty()) {
    auto p = q.front();
    int weight = qq.front();
    if (weight == 0) break;
    qq.pop();
    q.pop();
    for (int k = 0; k < 4; k++) {
      int x = p.first + dx[k];
      int y = p.second + dy[k];
      if (x >= 0 && x < n && y >= 0 && y < m && was[x][y] != w &&
          d[x][y] != '*') {
        q.push({x, y});
        qq.push(weight / 2);
        was[x][y] = w;
        ans[x][y] += weight / 2;
      }
    }
  }
  w++;
}
signed main() {
  int p;
  cin >> n >> m >> mnog >> p;
  vector<pair<pair<int, int>, char>> bykvi;
  bykvi.reserve(250);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      cin >> d[i][j];
      if (d[i][j] <= 'Z' && d[i][j] >= 'A') {
        bykvi.push_back({{i, j}, d[i][j]});
      }
    }
  for (auto x : bykvi) {
    bfs(x.first.first, x.first.second, x.second - 'A' + 1);
  }
  int r = 0;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) {
      if (ans[i][j] > p) {
        r++;
      }
    }
  cout << r;
}
