#include <bits/stdc++.h>
using namespace std;
string ys = "YES", no = "NO", st;
int di[8] = {1, 0, -1, 0, -1, 1, -1, 1};
int dj[8] = {0, -1, 0, 1, 1, 1, -1, -1};
const int N = 1.5 * 10000000 + 16;
const long long int OO = 1e18;
long long int mod = 1e9 + 7;
void fast() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  fast();
  int q;
  q = 1;
  while (q--) {
    int n, m, x;
    cin >> n >> m >> x;
    map<char, bool> mp;
    vector<pair<int, int>> shift;
    map<char, vector<pair<int, int>>> pos;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        char a;
        cin >> a;
        if (a == 'S')
          shift.push_back({i, j});
        else
          pos[a].push_back({i, j});
      }
    }
    for (char a = 'a'; a <= 'z'; a++)
      if (pos[a].size()) mp[a] = true;
    for (char a = 'A'; a <= 'Z'; a++) {
      char c = tolower(a);
      if (shift.size() && pos[c].size()) {
        for (auto i : pos[c])
          for (auto j : shift)
            if (pow((i.first - j.first), 2) + pow((i.second - j.second), 2) <=
                pow(x, 2)) {
              mp[a] = true;
              break;
            }
      }
    }
    int ans = 0;
    string s;
    cin >> n >> s;
    for (auto i : s) {
      if (islower(i)) {
        if (!mp[i]) return cout << -1 << "\n", 0;
      } else {
        if (!mp[i]) {
          if (!shift.size() || !pos[tolower(i)].size())
            return cout << -1 << "\n", 0;
          ans++;
        }
      }
    }
    return cout << ans << "\n", 0;
  }
}
