#include <bits/stdc++.h>
using namespace std;
int a[26 * 2], dist[26 * 2], x;
char keyb[60][60];
bool dis(int a, int b) {
  if (a * a + b * b > x * x)
    return false;
  else
    return true;
}
void right(int a, int b, int c, int d) {
  if (keyb[a][b] == 'S') return;
  if (dis(a - c, b - d)) {
    dist[keyb[a][b] - 'a'] = 1;
    return;
  }
  return;
}
int main() {
  char c;
  int n, m, i, j, k;
  bool Shift = false;
  scanf("%d %d %d", &n, &m, &x);
  for (i = 0; i < 2 * 26; i++) {
    a[i] = 0;
    dist[i] = 0;
  }
  scanf("%c", &c);
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      scanf("%c", &keyb[i][j]);
      if (keyb[i][j] == 'S')
        Shift = true;
      else
        a[keyb[i][j] - 'a'] = 1;
    }
    scanf("%c", &c);
  }
  for (i = 0; i < n; i++) {
    for (j = 0; j < m; j++) {
      if (keyb[i][j] == 'S') {
        for (int i1 = 0; i1 < n; i1++) {
          for (int j1 = 0; j1 < m; j1++) {
            right(i1, j1, i, j);
          }
        }
      }
    }
  }
  scanf("%d", &x);
  scanf("%c", &c);
  bool ok = true;
  int ans = 0;
  for (i = 0; i < x; i++) {
    scanf("%c", &c);
    if (c < 'a') {
      if (!Shift) {
        printf("-1\n");
        return 0;
      }
      if (a[c - 'a' + 32] == 0) {
        printf("-1\n");
        return 0;
      }
      if (dist[c - 'a' + 32] == 0) ans++;
    } else {
      if (a[c - 'a'] == 0) {
        printf("-1\n");
        return 0;
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
