#include <bits/stdc++.h>
using namespace std;
int c = 56;
const long long int mod = 1000000007;
const unsigned long long INF_ULL = 1e18;
const int INF_I = 1e9 + 9;
string itoa(int a) {
  ostringstream s;
  s << a;
  return s.str();
};
int atoi(string x) {
  int k(0);
  for (int i(0); i < x.size(); i++) k = k * 10 + (x[i] - '0');
  return k;
}
long long int powmod(long long int a, long long int b) {
  long long int res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
long long int gcd(long long int a, long long int b) {
  if (b == 0) {
    return a;
  } else {
    return gcd(b, a % b);
  }
}
vector<int> del_n(uint64_t n) {
  vector<int> res;
  while (n) {
    res.push_back(n % 10);
    n /= 10;
  }
  return res;
}
int sz_num(int num) {
  int sum = 0;
  if (num == 0) return 1;
  while (num) {
    sum++;
    num /= 10;
  }
  return sum;
}
bool solve() {
  int n, m, q, p;
  cin >> n >> m >> q >> p;
  vector<vector<int>> ans(n, vector<int>(m, 0));
  vector<pair<char, pair<int, int>>> tmp;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      char c;
      cin >> c;
      if (c == '*') ans[i][j] = INF_I;
      if (c >= 'A' && c <= 'Z') {
        tmp.push_back({c, {i, j}});
      }
    }
  }
  vector<vector<int>> arr(n, vector<int>(m, 0));
  for (int i = 0; i < tmp.size(); i++) {
    char c = tmp[i].first;
    int shum = (c - 'A' + 1) * q;
    arr[tmp[i].second.first][tmp[i].second.second] = shum;
    ans[tmp[i].second.first][tmp[i].second.second] += shum;
    queue<pair<int, int>> que;
    que.push({tmp[i].second.first, tmp[i].second.second});
    vector<vector<bool>> used(n, vector<bool>(m, false));
    used[tmp[i].second.first][tmp[i].second.second] = true;
    while (!que.empty()) {
      pair<int, int> pos = que.front();
      que.pop();
      int shum_pol = static_cast<int>(floor(arr[pos.first][pos.second] / 2.));
      arr[pos.first][pos.second] = 0;
      if (shum_pol == 0) continue;
      for (int di = -1; di <= 1; di++) {
        for (int dj = -1; dj <= 1; dj++) {
          if (di + dj == 0 || di == dj) continue;
          int toi = pos.first + di;
          int toj = pos.second + dj;
          if (toi >= n || toi < 0) continue;
          if (toj >= m || toj < 0) continue;
          if (used[toi][toj] == true) continue;
          if (ans[toi][toj] == INF_I) continue;
          arr[toi][toj] = shum_pol;
          ans[toi][toj] += arr[toi][toj];
          que.push({toi, toj});
          used[toi][toj] = true;
        }
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (ans[i][j] == INF_I) {
        continue;
      }
      if (ans[i][j] > p) res++;
    }
  }
  cout << res << endl;
  return 1;
}
int main() {
  solve();
  return 0;
}
