#include <bits/stdc++.h>
using namespace std;
struct bien {
  int hang, cot;
  int gt;
};
struct bien1 {
  int hang, cot;
};
bien1 h[4] = {-1, 0, 0, 1, 1, 0, 0, -1};
bien q[62600];
int nhang, ncot;
int sonhan;
long long maxx;
char s[255][255];
long long gt[255][255];
int d[255][255];
int itest;
int kq;
void loang(int hang, int cot, int nhan) {
  int i;
  int hang1, cot1;
  int dau, cuoi;
  q[0].hang = hang;
  q[0].cot = cot;
  q[0].gt = nhan * sonhan;
  gt[hang][cot] += nhan * sonhan;
  d[hang][cot] = itest;
  dau = -1;
  cuoi = 0;
  while (dau < cuoi) {
    dau++;
    for (i = 0; i < 4; i++) {
      hang1 = q[dau].hang + h[i].hang;
      cot1 = q[dau].cot + h[i].cot;
      if (hang1 < 0 || cot1 < 0 || hang1 == nhang || cot1 == ncot) {
        continue;
      }
      if (d[hang1][cot1] != itest && s[hang1][cot1] != '*') {
        d[hang1][cot1] = itest;
        gt[hang1][cot1] += q[dau].gt / 2;
        if (q[dau].gt / 2 > 0) {
          cuoi++;
          q[cuoi].hang = hang1;
          q[cuoi].cot = cot1;
          q[cuoi].gt = q[dau].gt / 2;
        }
      }
    }
  }
}
void solve() {
  int i, j;
  itest = 1;
  for (i = 0; i < nhang; i++) {
    for (j = 0; j < ncot; j++) {
      if (s[i][j] >= 'A' && s[i][j] <= 'Z') {
        loang(i, j, s[i][j] - 'A' + 1);
        itest++;
      }
    }
  }
  kq = 0;
  for (i = 0; i < nhang; i++) {
    for (j = 0; j < ncot; j++) {
      if (gt[i][j] > maxx) {
        kq++;
      }
    }
  }
}
void output() { printf("%d\n", kq); }
int main() {
  int i;
  while (scanf("%d %d %d %I64d", &nhang, &ncot, &sonhan, &maxx) > 0) {
    for (i = 0; i < nhang; i++) {
      scanf("%s", &s[i]);
    }
    solve();
    output();
  }
  return 0;
}
