#include <bits/stdc++.h>
using namespace std;
#pragma optimize("-O3")
vector<pair<int, int>> v2;
int cnt[300][300];
int dis[300][300];
int po[30];
int n, m, qq, p;
char arr[300][300];
bool che(int i, int j) {
  if (i >= 0 && i < n && j >= 0 && j < m && arr[i][j] != '*') {
    return 1;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> qq >> p;
  v2.push_back({1, 0});
  v2.push_back({-1, 0});
  v2.push_back({0, 1});
  v2.push_back({0, -1});
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> arr[i][j];
    }
  }
  po[0] = 1;
  for (int i = 1; i < 30; i++) {
    po[i] = 2 * po[i - 1];
  }
  for (int i = 0; i < 300; i++) {
    for (int j = 0; j < 300; j++) {
      dis[i][j] = 1e9;
    }
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (arr[i][j] == '*' || arr[i][j] == '.') {
        continue;
      }
      int num = arr[i][j] - 'A' + 1;
      queue<pair<int, int>> q;
      dis[i][j] = 0;
      q.push({i, j});
      vector<pair<int, int>> vec;
      vec.push_back({i, j});
      while (!q.empty()) {
        auto u = q.front();
        q.pop();
        int d = dis[u.first][u.second];
        if (d > 25) {
          break;
        }
        cnt[u.first][u.second] += ((num * qq) / po[d]);
        for (auto uu : v2) {
          if (che(uu.first + u.first, uu.second + u.second) &&
              dis[uu.first + u.first][uu.second + u.second] > 1 + d) {
            dis[uu.first + u.first][uu.second + u.second] = 1 + d;
            vec.push_back({uu.first + u.first, uu.second + u.second});
            q.push({uu.first + u.first, uu.second + u.second});
          }
        }
      }
      for (auto u : vec) {
        dis[u.first][u.second] = 1e9;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 300; i++) {
    for (int j = 0; j < 300; j++) {
      if (cnt[i][j] > p) {
        ans++;
      }
    }
  }
  cout << ans;
  return 0;
}
