#include <bits/stdc++.h>
using namespace std;
bool Euclidean(int a, int b, int c, int d, int x) {
  float dist = sqrt((c - a) * (c - a) + (d - b) * (d - b));
  float z = x;
  if (dist <= x)
    return true;
  else
    return false;
}
int main() {
  int n, m, r;
  cin >> n >> m >> r;
  vector<string> v1;
  vector<pair<int, int> > v2;
  bool present[26];
  for (int i = 0; i < 26; i++) {
    present[i] = false;
  }
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v1.push_back(s);
    for (int j = 0; j < s.length(); j++) {
      if (s[j] == 'S') v2.push_back(make_pair(i, j));
      int x = s[j];
      if (x >= 97 && x <= 122) present[x - 97] = true;
    }
  }
  bool arr[26];
  for (int i = 0; i < 26; i++) {
    arr[i] = false;
  }
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if (v1[i][j] != 'S') {
        for (int k = 0; k < v2.size(); k++) {
          if (Euclidean(i, j, v2[k].first, v2[k].second, r) == true)
            arr[v1[i][j] - 97] = true;
        }
      }
    }
  }
  int w;
  cin >> w;
  string s1;
  cin >> s1;
  int ctr = 0;
  int flag = 0;
  for (int i = 0; i < s1.length(); i++) {
    {
      int x = s1[i];
      if (s1[i] >= 65 && s1[i] <= 90) {
        if (present[s1[i] - 65] == true) {
          if (arr[s1[i] - 65] == false) ctr++;
        } else
          flag++;
      }
      if (s1[i] >= 65 && s1[i] <= 90) {
        if (v2.size() == 0) flag++;
      }
    }
    int x = s1[i];
    if (x >= 97 && x <= 122) {
      if (present[x - 97] == false) flag++;
    }
  }
  if (flag == 0)
    cout << ctr;
  else
    cout << "-1";
}
