#include <bits/stdc++.h>
using namespace std;
int b[312345], ll, rr, tt, i, j, c[211456], d[213456], a[311567], inf;
int x, m, n, r, s, t, k, l, y, z;
string p[345], qq;
vector<int> q, w;
int main() {
  cin >> n >> m >> x;
  for (i = 0; i < n; i++) {
    cin >> p[i];
    for (j = 0; j < m; j++) {
      if (p[i][j] != 'S') {
        a[p[i][j]] = 1;
        b[p[i][j]] = 1;
        b[p[i][j] - 32] = 1;
      } else {
        q.push_back(i);
        w.push_back(j);
      }
    }
  }
  l = q.size();
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (p[i][j] != 'S') {
        for (r = 0; r < l; r++) {
          if ((q[r] - i) * (q[r] - i) + (w[r] - j) * (w[r] - j) <= x * x) {
            a[p[i][j] - 32] = 1;
            break;
          }
        }
      }
    }
  }
  cin >> n >> qq;
  for (auto u : qq) {
    if (b[u] == 0) {
      cout << -1;
      return 0;
    }
    if (l == 0 && u < 95) {
      cout << -1;
      return 0;
    }
    if (a[u] == 0) {
      s++;
    }
  }
  cout << s;
  return 0;
}
