#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
const int N = 251;
char M[N][N];
long long int first[N][N];
int vis[N][N];
int iter = 0;
int n, m, q;
long long int p;
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
bool valid(int x, int y) {
  return (x >= 0 and x < n and y >= 0 and y < m and M[x][y] != '*');
}
void solve(int x, int y, int val) {
  queue<pair<pair<int, int>, int>> q;
  q.push({{x, y}, val});
  vis[x][y] = iter;
  while (!q.empty()) {
    auto cur = q.front();
    q.pop();
    int x = cur.first.first, y = cur.first.second;
    int val = cur.second;
    first[x][y] += val;
    for (int i = 0; i < 4; i++)
      if (valid(x + dx[i], y + dy[i]) and val / 2 > 0 and
          vis[x + dx[i]][y + dy[i]] != iter) {
        vis[x + dx[i]][y + dy[i]] = iter;
        q.push({{x + dx[i], y + dy[i]}, val / 2});
      }
  }
}
int main() {
  scanf("%d", &n), scanf("%d", &m), scanf("%d", &q), scanf("%d", &p);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> M[i][j];
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (M[i][j] != '*' and M[i][j] != '.') {
        iter++;
        solve(i, j, q * (M[i][j] - 'A' + 1));
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) ans += (first[i][j] > p);
  }
  printf("%d\n", ans);
  return 0;
}
