#include <bits/stdc++.h>
using namespace std;
long long n, m;
vector<vector<char>> g;
vector<vector<long long>> d;
vector<vector<bool>> vis;
void bfs(long long i, long long j, long long k) {
  queue<pair<pair<long long, long long>, long long>> q;
  q.push(make_pair(make_pair(i, j), k));
  while (!q.empty()) {
    auto u = q.front();
    q.pop();
    if (vis[u.first.first][u.first.second]) continue;
    d[u.first.first][u.first.second] += u.second;
    k = u.second;
    vis[u.first.first][u.first.second] = true;
    i = u.first.first;
    j = u.first.second;
    if (i - 1 >= 1 && g[i - 1][j] != '*' && !vis[i - 1][j] && k / 2)
      q.push(make_pair(make_pair(i - 1, j), k / 2));
    if (i + 1 <= n && g[i + 1][j] != '*' && !vis[i + 1][j] && k / 2)
      q.push(make_pair(make_pair(i + 1, j), k / 2));
    if (j - 1 >= 1 && g[i][j - 1] != '*' && !vis[i][j - 1] && k / 2)
      q.push(make_pair(make_pair(i, j - 1), k / 2));
    if (j + 1 <= m && g[i][j + 1] != '*' && !vis[i][j + 1] && k / 2)
      q.push(make_pair(make_pair(i, j + 1), k / 2));
  }
}
void solve() {
  long long q, p;
  cin >> n >> m >> q >> p;
  g.assign(n + 1, vector<char>(m + 1));
  d.assign(n + 1, vector<long long>(m + 1));
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++) cin >> g[i][j];
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      vis.assign(n + 1, vector<bool>(m + 1, false));
      if (g[i][j] != '.' && g[i][j] != '*') bfs(i, j, (g[i][j] - 'A' + 1) * q);
    }
  }
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j <= m; j++)
      if (d[i][j] > p) ans++;
  cout << ans << '\n';
  ;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int tc;
  tc = 1;
  for (int i = 1; i <= tc; i++) {
    solve();
  }
  return 0;
}
