#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, q, cnt = 0;
  float dis = 10000;
  cin >> n >> m >> x;
  string kb = "";
  vector<pair<int, int> > S;
  char cs;
  for (int i = 0; i < n * m; i++) {
    cin >> cs;
    kb += cs;
    if (kb[i] == 'S') S.push_back(make_pair(i / m, i % m));
  }
  int l = S.size();
  cin >> q;
  string txt = "";
  string cap = "";
  char c;
  for (int i = 0; i < q; i++) {
    cin >> c;
    if (c < 'a')
      cap += c;
    else
      txt += c;
  }
  int l1 = txt.length(), l2 = cap.length();
  for (int i = 0; i < l1; i++) {
    size_t found = kb.find(txt[i]);
    if (found == string::npos) {
      cout << -1;
      return 0;
    }
  }
  size_t f_s = kb.find('S');
  if (f_s == string::npos && l2 > 0) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < l2; i++) {
    char cc = (char)(cap[i] + 32);
    size_t found = kb.find(cc);
    if (found == string::npos) {
      cout << -1;
      return 0;
    }
  }
  for (int i = 0; i < n * m; i++) {
    for (int j = 0; j < l; j++) {
      if (dis >
          (pow(S[j].first - (i) / m, 2) + pow(S[j].second - ((i) % m), 2))) {
        dis = pow(S[j].first - (i) / m, 2) + pow(S[j].second - ((i) % m), 2);
      }
    }
    if (dis > x * x) kb[i] = kb[i] - 32;
    dis = 10000;
  }
  for (int i = 0; i < l2; i++) {
    char cc = (char)(cap[i] + 32);
    size_t found = kb.find(cc);
    if (found == string::npos) {
      cnt++;
    }
  }
  cout << cnt;
  return 0;
}
