#include <bits/stdc++.h>
using namespace std;
int dist(int x1, int y1, int x2, int y2) {
  return abs(x1 - x2) * abs(x1 - x2) + abs(y1 - y2) * abs(y1 - y2);
}
int main() {
  cin.tie(0)->sync_with_stdio(0);
  int n, m, x, q;
  int res = 0;
  char c;
  string s;
  bool ok = true;
  vector<pair<int, int>> kb[26];
  vector<pair<int, int>> sh;
  cin >> n >> m >> x;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    for (int j = 0; j < m; ++j) {
      c = s[j];
      if ('a' <= c && 'z' >= c) {
        kb[c - 'a'].push_back({i, j});
      } else {
        sh.push_back({i, j});
      }
    }
  }
  s = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  vector<int> st(256, 0);
  cin >> q;
  for (int i = 0; i < 52; ++i) {
    c = s[i];
    if (islower(c)) {
      if (kb[c - 'a'].empty()) st[c - 'A'] = -1;
    } else if (isupper(c)) {
      c = tolower(c);
      if (kb[c - 'a'].empty()) {
        st[s[i] - 'A'] = -1;
      } else if (sh.empty()) {
        st[s[i] - 'A'] = -1;
      } else {
        bool enough = false;
        for (auto k : kb[c - 'a']) {
          for (auto shift : sh) {
            if (dist(k.first, k.second, shift.first, shift.second) <= x * x) {
              enough = true;
            }
          }
        }
        if (!enough) {
          st[s[i] - 'A'] = 1;
        }
      }
    }
  }
  cin >> s;
  for (int i = 0; i < q; ++i) {
    c = s[i];
    if (st[c - 'A'] == -1) {
      ok = false;
      break;
    } else if (st[c - 'A'] == 1) {
      res++;
    }
  }
  if (!ok) {
    cout << -1 << '\n';
  } else {
    cout << res << '\n';
  }
  return 0;
}
