#include <bits/stdc++.h>
using namespace std;
vector<vector<char>> input;
vector<vector<bool>> used;
int n, m;
long long q, p;
void add_children(int i, int j, vector<pair<long long, long long>>& a) {
  if (input[i][j] == '*') {
    return;
  }
  if (i != 0 && input[i - 1][j] != '*') {
    a.push_back({i - 1, j});
  }
  if (j != m - 1 && input[i][j + 1] != '*') {
    a.push_back({i, j + 1});
  }
  if (i != n - 1 && input[i + 1][j] != '*') {
    a.push_back({i + 1, j});
  }
  if (j != 0 && input[i][j - 1] != '*') {
    a.push_back({i, j - 1});
  }
}
bool comp(pair<pair<int, int>, char>& a, pair<pair<int, int>, char>& b) {
  return a.second < b.second;
}
int main() {
  cin >> n >> m >> q >> p;
  input.assign(n, vector<char>(m));
  vector<vector<long long>> input_counters(n, vector<long long>(m));
  vector<pair<pair<int, int>, char>> ind;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      cin >> input[i][j];
      if ((input[i][j] > 64 && input[i][j] < 91)) {
        ind.push_back({{i, j}, input[i][j]});
      }
    }
  sort(ind.begin(), ind.end());
  vector<vector<vector<pair<long long, long long>>>> g(
      n, vector<vector<pair<long long, long long>>>(m));
  used.assign(n, vector<bool>(m));
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < m; ++j) {
      add_children(i, j, g[i][j]);
    }
  queue<pair<pair<int, int>, long long>> q_kw;
  for (int i = 0; i < ind.size(); ++i) {
    used.assign(n, vector<bool>(m, false));
    long long now_q = (ind[i].second - 64) * q;
    input_counters[ind[i].first.first][ind[i].first.second] += now_q;
    q_kw.push({ind[i].first, now_q});
    used[ind[i].first.first][ind[i].first.second] = true;
    while (!q_kw.empty()) {
      auto cur = q_kw.front();
      q_kw.pop();
      for (int it = 0; it < g[cur.first.first][cur.first.second].size(); ++it) {
        auto tmp_kw = g[cur.first.first][cur.first.second][it];
        if (!used[tmp_kw.first][tmp_kw.second]) {
          input_counters[tmp_kw.first][tmp_kw.second] += cur.second / 2;
          used[tmp_kw.first][tmp_kw.second] = true;
          if (cur.second > 1) {
            q_kw.push({tmp_kw, cur.second / 2});
          }
        }
      }
    }
  }
  int result = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      if (input_counters[i][j] > p) {
        ++result;
      }
    }
  }
  cout << result;
}
