#include <bits/stdc++.h>
using namespace std;
int main() {
  bool keyboard[26] = {false};
  int n, m, x;
  long long int q;
  string input;
  vector<pair<int, int>> shifts;
  pair<int, int> keyboardKeys[26];
  while (cin >> n) {
    cin >> m >> x;
    string keyboardS[n];
    for (int i = 0; i < n; i++) {
      cin >> keyboardS[i];
      for (int j = 0; j < m; j++) {
        char buffer = (keyboardS[i])[j];
        if (buffer == 'S') {
          shifts.push_back(make_pair(i, j));
        } else {
          keyboard[buffer - 'a'] = true;
          keyboardKeys[buffer - 'a'] = make_pair(i, j);
        }
      }
    }
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        char buffer = (keyboardS[i])[j];
        if (buffer != 'S') {
          for (auto &s : shifts) {
            double dist = sqrt(pow(s.first - i, 2) + pow(s.second - j, 2));
            if (dist <= x) {
              keyboardKeys[buffer - 'a'] = make_pair(i, j);
            }
          }
        }
      }
    }
    cin >> q;
    cin >> input;
    long long int count = 0;
    for (long long int i = 0; i < q; i++) {
      if (!keyboard[tolower(input[i]) - 'a'] ||
          (input[i] <= 90 && shifts.size() == 0)) {
        cout << "-1" << endl;
        return 0;
      } else {
        int a = keyboardKeys[tolower(input[i]) - 'a'].first;
        int b = keyboardKeys[tolower(input[i]) - 'a'].second;
        double dist = x + 1;
        if (input[i] <= 90) {
          for (auto &i : shifts) {
            dist = min(dist, sqrt(pow(a - i.first, 2) + pow(b - i.second, 2)));
          }
          if (dist > x) count++;
        }
      }
    }
    cout << count << endl;
  }
}
