#include <bits/stdc++.h>
using namespace std;
template <typename T>
T BigMod(T b, T p, T m) {
  if (p == 0) return 1;
  if (p % 2 == 0) {
    T s = BigMod(b, p / 2, m);
    return ((s % m) * (s % m)) % m;
  }
  return ((b % m) * (BigMod(b, p - 1, m) % m)) % m;
}
template <typename T>
T ModInv(T b, T m) {
  return BigMod(b, m - 2, m);
}
template <typename T>
T gcd(T a, T b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long dx[] = {0, 0, -1, 1};
long long dy[] = {-1, 1, 0, 0};
long long a[258][258], ok, r, c, got[30];
vector<int> v;
char s[258][258];
long long vis[258][258];
inline void bfs(long long rr, long long cc) {
  queue<int> q;
  long long cur = got[s[rr][cc] - 'A' + 1];
  a[rr][cc] += cur;
  vis[rr][cc] = ok;
  q.push(rr);
  q.push(cc);
  q.push(cur);
  long long i;
  while (q.size()) {
    rr = q.front();
    q.pop();
    cc = q.front();
    q.pop();
    cur = q.front();
    q.pop();
    for (i = 0; i <= 3; i++) {
      long long rw = rr + dx[i];
      long long cl = cc + dy[i];
      if ((rw >= 0 && rw <= r - 1) && (cl >= 0 && cl <= c - 1) &&
          vis[rw][cl] != ok && s[rw][cl] != '*') {
        long long now = cur / 2;
        if (now > 0) {
          a[rw][cl] += now;
          vis[rw][cl] = ok;
          q.push(rw);
          q.push(cl);
          q.push(now);
        }
      }
    }
  }
}
int main() {
  long long t, i, j, e, n, k, l, ed, res, p, y, n1, n2, sum, cnt, dif, idx, x,
      m, val, cst, st, sz, lim, nois;
  scanf("%lld %lld %lld %lld", &r, &c, &nois, &lim);
  char ch;
  for (i = 1, ch = 'A'; ch <= 'Z'; i++, ch++) got[ch - 'A' + 1] = i * nois;
  for (i = 0; i <= r - 1; i++) {
    scanf("%s", &s[i]);
    for (j = 0; j <= c - 1; j++) {
      if ((s[i][j] >= 'A' && s[i][j] <= 'Z')) {
        v.push_back(i);
        v.push_back(j);
      }
    }
  }
  sz = v.size();
  for (i = 0; i < sz; i += 2) {
    ok++;
    x = v[i];
    y = v[i + 1];
    bfs(x, y);
  }
  cnt = 0;
  for (i = 0; i <= r - 1; i++)
    for (j = 0; j <= c - 1; j++) cnt += (a[i][j] > lim);
  printf("%lld\n", cnt);
  return 0;
}
