#include <bits/stdc++.h>
using namespace std;
const long long Llinf = LLONG_MAX;
const int Inf = INT_MAX;
const int Maxn = 1e5 + 10;
const int Mod = 1e9 + 7;
char* _c = new char[Maxn];
string GetString() {
  scanf("%s", _c);
  return string(_c);
}
int n, m, q, p;
char a[251][251];
long long ns[251][251];
int vis[251][251];
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
int c, ans;
bool Valid(int first, int second) {
  return (first >= 0 && first < n && second >= 0 && second < m &&
          a[first][second] != '*');
}
void Bfs(int first, int second, int q, int c) {
  queue<pair<pair<int, int>, int> > Q;
  Q.push(make_pair(pair<int, int>(first, second), q));
  vis[first][second] = c;
  while (!Q.empty()) {
    int first = Q.front().first.first;
    int second = Q.front().first.second;
    int d = Q.front().second;
    Q.pop();
    if (d == 0) break;
    ns[first][second] += 1ll * d;
    if (ns[first][second] > p) ns[first][second] = Inf;
    for (int i = 0; i < 4; i++) {
      int new_x = first + dx[i];
      int new_y = second + dy[i];
      if (Valid(new_x, new_y) && vis[new_x][new_y] != c) {
        Q.push(make_pair(pair<int, int>(new_x, new_y), d / 2));
        vis[new_x][new_y] = c;
      }
    }
  }
}
int main() {
  scanf("%d%d%d%d", &n, &m, &q, &p);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++) scanf(" %c", &a[i][j]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (a[i][j] >= 'A' && a[i][j] <= 'Z')
        Bfs(i, j, (a[i][j] - 'A' + 1) * q, ++c);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < m; j++)
      if (ns[i][j] == 1ll * Inf) ans++;
  printf("%d\n", ans);
  return 0;
}
