#include <bits/stdc++.h>
using namespace std;
template <typename T>
T prod(const T &a, const T &b, const T &mod) {
  return ((a % mod) * (b % mod)) % mod;
}
template <typename T>
T pow_(const T &a, const T &b) {
  if (b == 0) return 1;
  T p = pow_(a, b / 2);
  p = p * p;
  return ((b % 2) ? (p * a) : p);
}
template <typename T>
T modpow(const T &a, const T &b, const T &mod) {
  if (b == 0) return 1;
  T p = modpow(a, b / 2, mod);
  p = prod(p, p, mod);
  return ((b % 2) ? prod(p, a, mod) : p);
}
template <typename T>
T max(const T &a, const T &b, const T &c) {
  return max(a, max(b, c));
}
template <typename T>
T min(const T &a, const T &b, const T &c) {
  return min(a, min(b, c));
}
template <typename T>
void dbg(const vector<T> &a) {
  for (int i = 0; i <= a.size() - 1; i++) cout << a[i] << " ";
  cout << endl;
}
template <typename T>
void dbg(const vector<T> &a, int st, int en) {
  for (int i = st; i <= en; i++) cout << a[i] << " ";
  cout << endl;
}
char mat[251][251];
int cost[251][251];
bool valid(int x, int y) {
  if (x < 0 || y < 0 || x > 250 || y > 250) return false;
  return (mat[x][y] != '*');
}
vector<int> power(((int)(1e5) + 1) + 1, 0);
void pre() {
  power[0] = 1;
  for (int i = 1; i <= ((int)(1e5) + 1); i++) power[i] = power[i - 1] * 2;
}
void bfs(int ux, int uy, int c) {
  queue<pair<int, int> > q;
  q.push(make_pair(ux, uy));
  int vis[251][251] = {{0}};
  int level = 0;
  while (!q.empty() && c >= power[level]) {
    int sz = q.size();
    while (sz--) {
      ux = q.front().first;
      uy = q.front().second;
      q.pop();
      if (vis[ux][uy]) continue;
      cost[ux][uy] += c / power[level];
      vis[ux][uy] = 1;
      int dx[] = {-1, 1, 0, 0};
      int dy[] = {0, 0, -1, 1};
      for (int i = 0; i <= 3; i++) {
        int vx = ux + dx[i];
        int vy = uy + dy[i];
        if (valid(vx, vy) && !vis[vx][vy]) {
          q.push(make_pair(vx, vy));
        }
      }
    }
    level++;
  }
}
void main_() {
  pre();
  int n, m, p, q;
  cin >> n >> m >> q >> p;
  for (int i = 0; i <= 250; i++)
    for (int j = 0; j <= 250; j++) {
      mat[i][j] = '*';
    }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) {
      cin >> mat[i][j];
    }
  }
  for (int i = 0; i <= n - 1; i++) {
    for (int j = 0; j <= m - 1; j++) {
      if (mat[i][j] >= 'A' && mat[i][j] <= 'Z') {
        bfs(i, j, (mat[i][j] - 'A' + 1) * q);
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= n - 1; i++)
    for (int j = 0; j <= m - 1; j++)
      if (cost[i][j] > p) ans++;
  cout << ans << endl;
}
int main() {
  { main_(); }
  return 0;
}
