#include <bits/stdc++.h>
using namespace std;
using pii = pair<int, int>;
using ll = long long;
using ull = unsigned long long;
using ld = double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vpll = vector<pair<ll, ll>>;
struct Node {
  Node() {}
  Node(ll a, ll b, ll c) : y(a), x(b), noise(c) {}
  ll y, x, noise;
};
ll N, M, Q, P;
char G[250][250];
ll GR[250][250];
vpll dir = {{-1, 0}, {0, -1}, {1, 0}, {0, 1}};
ll pyth(ll x1, ll x2, ll y1, ll y2) {
  return (x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1);
}
void bfs(ll _y, ll _x, ll _n) {
  bitset<250> V[250];
  queue<Node> Q;
  Q.push(Node(_y, _x, _n));
  while (!Q.empty()) {
    auto u = Q.front();
    Q.pop();
    if (V[u.y][u.x] || G[u.y][u.x] == '*') continue;
    if (G[u.y][u.x] != '*') GR[u.y][u.x] += u.noise;
    V[u.y][u.x] = 1;
    if (u.noise <= 1) continue;
    for (const auto& d : dir) {
      ll y = u.y + d.first, x = u.x + d.second;
      if (x < 0 || y < 0 || x >= M || y >= N || V[y][x] || G[y][x] == '*')
        continue;
      else
        Q.push(Node(y, x, u.noise >> 1));
    }
  }
}
int main(void) {
  ios::sync_with_stdio(false);
  scanf(" %lld %lld %lld %lld", &N, &M, &Q, &P);
  for (auto i = ((0ll)); i < ((N)); ++i)
    for (auto j = ((0ll)); j < ((M)); ++j) {
      if (j == M) continue;
      scanf(" %c", &G[i][j]);
    }
  for (auto i = ((0ll)); i < ((N)); ++i)
    for (auto j = ((0ll)); j < ((M)); ++j)
      if (G[i][j] >= 'A' && G[i][j] <= 'Z') bfs(i, j, (G[i][j] - 'A' + 1) * Q);
  int res = 0;
  for (auto i = ((0ll)); i < ((N)); ++i)
    for (auto j = ((0ll)); j < ((M)); ++j)
      if (GR[i][j] > P) ++res;
  printf("%d\n", res);
  return 0;
}
