#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, xx;
  cin >> n >> m >> xx;
  map<char, long long int> mp;
  vector<char> v[n];
  for (long long int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (auto j : s) v[i].push_back(j);
    for (long long int j = 0; j < m; j++) mp[s[j]]++;
  }
  if (mp['S'] > 0) {
    mp['S'] = 0;
    for (auto i : mp) {
      char c = i.first - 32;
      if (i.first != 'S') mp[c]++;
    }
  }
  long long int q;
  cin >> q;
  string s;
  cin >> s;
  for (long long int i = 0; i < q; i++) {
    if (mp[s[i]] == 0) {
      cout << "-1";
      return 0;
    }
  }
  vector<pair<long long int, long long int>> shift;
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      if (v[i][j] == 'S') shift.push_back({i, j});
    }
  }
  vector<long long int> chk[200];
  for (long long int i = 0; i < n; i++) {
    for (long long int j = 0; j < m; j++) {
      for (auto m : shift) {
        long long int x = m.first;
        long long int y = m.second;
        long long int ans = ((x - i) * (x - i)) + ((y - j) * (y - j));
        if (ans <= (xx * xx)) chk[v[i][j] - 32].push_back(ans);
      }
    }
  }
  long long int c = 0;
  for (long long int i = 0; i < q; i++) {
    if (s[i] >= 'A' && s[i] <= 'Z') {
      for (auto j : chk[s[i]]) {
        if (j <= (xx * xx)) goto done;
      }
      c++;
    }
  done:
    1;
  }
  cout << c;
}
