#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9 + 10;
const int mod = (int)1e9 + 7;
const int N = (int)1e6 + 10;
const long long LLINF = (long long)8e18 + 10;
const double pi = acos(-1.0);
template <typename T1, typename T2>
bool umin(T1 &x, const T2 &y) {
  if (x > y) return x = y, true;
  return false;
}
template <typename T1, typename T2>
bool umax(T1 &x, const T2 &y) {
  if (x < y) return x = y, true;
  return false;
}
template <typename T>
T getint() {
  char c = getchar();
  T p = 1, x = 0;
  while (c == ' ' || c == '\n') c = getchar();
  if (c == '-') p = -1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return x * p;
}
int add[40];
int d[300][300];
long long ans[300][300];
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
char a[300][300];
int n, m, q, p;
void bfs(int x, int y, int val) {
  add[0] = val;
  for (int i = 1; i < 27; ++i) {
    add[i] = add[i - 1] / 2;
  }
  for (int i = 1; i <= n; ++i) {
    int del = 31 - abs(x - i);
    for (int j = max(1, y - del); j <= min(y + del, m); ++j) {
      d[i][j] = INF;
    }
  }
  d[x][y] = 0;
  queue<int> qx, qy;
  qx.push(x);
  qy.push(y);
  while (qx.size()) {
    int x = qx.front();
    qx.pop();
    int y = qy.front();
    qy.pop();
    if (d[x][y] > 26) continue;
    for (int i = 0; i < 4; ++i) {
      if (x + dx[i] < 1 || x + dx[i] > n) continue;
      if (y + dy[i] < 1 || y + dy[i] > m) continue;
      if (a[x + dx[i]][y + dy[i]] == '*') continue;
      if (umin(d[x + dx[i]][y + dy[i]], d[x][y] + 1))
        qx.push(x + dx[i]), qy.push(y + dy[i]);
    }
  }
  for (int i = 1; i <= n; ++i) {
    int del = 31 - abs(x - i);
    for (int j = max(1, y - del); j <= min(y + del, m); ++j) {
      if (d[i][j] < 27) ans[i][j] += add[d[i][j]];
    }
  }
}
int main() {
  srand(time(NULL));
  n = getint<int>();
  m = getint<int>();
  q = getint<int>();
  p = getint<int>();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      a[i][j] = getchar();
    }
    getchar();
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (a[i][j] == '.' || a[i][j] == '*') continue;
      bfs(i, j, (a[i][j] - 'A' + 1) * q);
    }
  }
  int res = 0;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= m; ++j) {
      if (ans[i][j] > p) ++res;
    }
  }
  printf("%d\n", res);
}
