#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = std::vector<int>;
using vll = std::vector<long long>;
using vull = std::vector<unsigned long long>;
void setIO(std::ifstream &readFile, std::ofstream &writeFile,
           const std::string &name = "", bool stdIO = false) {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  std::cout.tie(nullptr);
  if (!name.empty() && !stdIO) {
    readFile.open(name + ".in");
    if (readFile.fail()) return;
    writeFile.open(name + ".out");
    std::cin.rdbuf(readFile.rdbuf());
    std::cout.rdbuf(writeFile.rdbuf());
  }
}
class Timer {
  std::chrono::time_point<std::chrono::high_resolution_clock> m_beg;

 public:
  Timer() : m_beg(std::chrono::high_resolution_clock::now()) {}
  void reset() { m_beg = std::chrono::high_resolution_clock::now(); }
  [[nodiscard]] long double elapsed() const {
    return std::chrono::duration_cast<
               std::chrono::duration<long double, std::ratio<1>>>(
               std::chrono::high_resolution_clock::now() - m_beg)
        .count();
  }
};
using dt = int;
constexpr dt MAXN = std::numeric_limits<dt>::max();
constexpr dt MOD = 1e9 + 7;
constexpr long double EPS = 1e-9;
int main(int argc, char *argv[]) {
  static std::ifstream readFile;
  static std::ofstream writeFile;
  setIO(readFile, writeFile, "");
  dt n, m, x;
  cin >> n >> m >> x;
  unordered_map<char, vector<pair<dt, dt>>> letters;
  vector<pair<dt, dt>> shifts;
  for (auto i = (0); i < (n); ++i)
    for (auto j = (0); j < (m); ++j) {
      char c;
      cin >> c;
      if (c == 'S')
        shifts.emplace_back(i, j);
      else
        letters[c].emplace_back(i, j);
    }
  vector<vector<bool>> works(n, vector<bool>(m, false));
  for (auto i = (0); i < (n); ++i)
    for (auto j = (0); j < (m); ++j)
      for (auto &shift : shifts)
        if (pow(i - shift.first, 2) + pow(j - shift.second, 2) <= x * x) {
          works[i][j] = true;
          break;
        }
  dt answer = 0;
  dt q;
  string s;
  cin >> q >> s;
  for (auto &c : s) {
    if (!letters.count(tolower(c)) || isupper(c) && shifts.empty())
      return cout << -1, 0;
    if (islower(c)) continue;
    bool work = false;
    for (auto &letter : letters[tolower(c)])
      if (works[letter.first][letter.second]) {
        work = true;
        break;
      }
    answer += !work;
  }
  cout << answer;
}
