#include <bits/stdc++.h>
using namespace std;
using ll = int;
template <typename T>
using v = vector<T>;
template <typename T1, typename T2>
using pa = pair<T1, T2>;
template <typename... T>
using tup = tuple<T...>;
ll dx[]{0, 1, 0, -1};
ll dy[]{1, 0, -1, 0};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  ll n, m, q, p;
  cin >> n >> m >> q >> p;
  v<string> a(n);
  for (ll i = 0; i < n; ++i) {
    cin >> a[i];
  }
  v<v<ll>> res(n, v<ll>(m, 0));
  v<v<ll>> cres(n, v<ll>(m, 0));
  v<v<bool>> was(n, v<bool>(m, false));
  for (ll bx = 0; bx < n; ++bx) {
    for (ll by = 0; by < m; ++by) {
      if ((a[bx][by] >= 'A') && (a[bx][by] <= 'Z')) {
        ll L = (a[bx][by] - 'A' + 1) * q;
        queue<tup<ll, ll, ll>> q;
        q.push({bx, by, L});
        v<pa<ll, ll>> was2;
        while (!q.empty()) {
          auto [cx, cy, cl] = q.front();
          q.pop();
          if (!was[cx][cy]) {
            was2.push_back({cx, cy});
            was[cx][cy] = true;
            cres[cx][cy] = cl;
            ll nl = cl >> 1;
            if (nl > 0) {
              for (ll i = 0; i < 4; ++i) {
                ll nx = cx + dx[i];
                ll ny = cy + dy[i];
                if ((nx >= 0) && (nx < n) && (ny >= 0) && (ny < m)) {
                  if (a[nx][ny] != '*') {
                    q.push({nx, ny, nl});
                  }
                }
              }
            }
          }
        }
        for (pa<ll, ll> x : was2) {
          auto [i, j] = x;
          res[i][j] += cres[i][j];
          was[i][j] = false;
          cres[i][j] = false;
        }
      }
    }
  }
  ll alpha = 0;
  for (v<ll> x : res) {
    for (ll y : x) {
      if (y > p) {
        ++alpha;
      }
    }
  }
  cout << alpha;
}
