#include <bits/stdc++.h>
using namespace std;
vector<vector<char>> field;
vector<vector<int>> loud;
vector<vector<bool>> used;
struct container {
  int i;
  int j;
  int noise;
  container(int I, int J, int N) : i(I), j(J), noise(N){};
};
void bfs(int i, int j, int noise) {
  vector<container> query;
  query.push_back(container(i, j, noise));
  int position = 0;
  while (position < query.size()) {
    int t_i = query[position].i;
    int t_j = query[position].j;
    int t_noise = query[position].noise;
    loud[t_i][t_j] += t_noise;
    used[t_i][t_j] = true;
    if (t_i > 0 && t_noise > 1 && field[t_i - 1][t_j] != '*' &&
        !used[t_i - 1][t_j]) {
      query.push_back(container(t_i - 1, t_j, t_noise >> 1));
      used[t_i - 1][t_j] = true;
    }
    if (t_j > 0 && t_noise > 1 && field[t_i][t_j - 1] != '*' &&
        !used[t_i][t_j - 1]) {
      query.push_back(container(t_i, t_j - 1, t_noise >> 1));
      used[t_i][t_j - 1] = true;
    }
    if (t_i < field.size() - 1 && t_noise > 1 && field[t_i + 1][t_j] != '*' &&
        !used[t_i + 1][t_j]) {
      query.push_back(container(t_i + 1, t_j, t_noise >> 1));
      used[t_i + 1][t_j] = true;
    }
    if (t_j < field[0].size() - 1 && t_noise > 1 &&
        field[t_i][t_j + 1] != '*' && !used[t_i][t_j + 1]) {
      query.push_back(container(t_i, t_j + 1, t_noise >> 1));
      used[t_i][t_j + 1] = true;
    }
    ++position;
  }
  for (int k = 0; k < query.size(); ++k) {
    used[query[k].i][query[k].j] = false;
  }
}
int main() {
  int n = 0, m = 0;
  cin >> n;
  cin >> m;
  int q = 0, p = 0;
  cin >> q;
  cin >> p;
  for (size_t i = 0; i < n; i++) {
    field.push_back(vector<char>(m));
    loud.push_back(vector<int>(m));
    used.push_back(vector<bool>(m));
  }
  for (size_t i = 0; i < n; i++) {
    string str;
    cin >> str;
    for (size_t j = 0; j < m; j++) {
      field[i][j] = str[j];
      loud[i][j] = 0;
      used[i][j] = false;
    }
  }
  for (size_t i = 0; i < n; i++) {
    for (size_t j = 0; j < m; j++) {
      if (field[i][j] >= 'A' && field[i][j] <= 'Z') {
        bfs(i, j, q * (field[i][j] - 'A' + 1));
      }
    }
  }
  int answer = 0;
  for (size_t i = 0; i < n; i++) {
    for (size_t j = 0; j < m; j++) {
      if (loud[i][j] > p) ++answer;
    }
  }
  cout << answer;
  return 0;
}
