#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, zx, x;
  scanf("%d", &n);
  scanf("%d", &zx);
  scanf("%d", &x);
  string str;
  vector<string> v;
  for (int i = 0; i < n; i++) {
    cin >> str;
    v.push_back(str);
  }
  int q;
  scanf("%d", &q);
  string str2;
  cin >> str2;
  set<char> s;
  for (int gh = 0; gh < q; gh++) {
    s.insert(str2[gh]);
  }
  int as = 0;
  vector<pair<int, int>> shift;
  vector<long long> store;
  long long a, b, c, d;
  int f = 1;
  long long mi;
  vector<char> refer;
  for (auto it = s.begin(); it != s.end(); it++) {
    store.clear();
    vector<pair<int, int>> letter;
    int flag = 0;
    int flag2 = 0;
    char m = *it;
    if (islower(m)) {
      for (int ii = 0; ii < n; ii++) {
        for (int jj = 0; jj < zx; jj++) {
          if (v[ii][jj] == m) {
            flag++;
          }
        }
      }
      if (flag == 0) {
        printf("-1");
        f = f * 0;
        break;
      }
    } else if (isupper(m)) {
      char o = tolower(m);
      for (int s = 0; s < n; s++) {
        for (int d = 0; d < zx; d++) {
          if (v[s][d] == o) {
            letter.push_back(make_pair(s, d));
            flag++;
          } else if (v[s][d] == 'S') {
            shift.push_back(make_pair(s, d));
            flag2++;
          }
        }
      }
      if (flag == 0 || flag2 == 0) {
        printf("-1");
        f = f * 0;
        break;
      } else {
        for (int u = 0; u < letter.size(); u++) {
          for (int t = 0; t < shift.size(); t++) {
            a = letter[u].first;
            b = shift[t].first;
            c = letter[u].second;
            d = shift[t].second;
            store.push_back((a - b) * (a - b) + (c - d) * (c - d));
          }
        }
        mi = store[0];
        for (int h = 1; h < store.size(); h++) {
          if (store[h] < mi) {
            mi = store[h];
          }
        }
        if (mi > (x * x)) {
          refer.push_back(*it);
        }
      }
    }
  }
  for (int tt = 0; tt < refer.size(); tt++) {
    for (int yy = 0; yy < q; yy++) {
      if (refer[tt] == str2[yy]) {
        as++;
      }
    }
  }
  if (f) {
    printf("%d", as);
  }
  return 0;
}
