#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T &val) {
  val = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    val = (val << 3) + (val << 1) + (c ^ 48);
    c = getchar();
  }
  val *= f;
}
const int K = 25;
int n, k, T, all, can[K], t[K], a[K][K], f[1 << K];
char s[200005];
int main() {
  scanf("%d%d%d%s", &n, &k, &T, s);
  for (int i = 0; i < n; i++) {
    s[i] -= 'A';
    all |= 1 << s[i];
  }
  for (int i = 0; i < k; i++) scanf("%d", &t[i]);
  for (int i = 0; i < k; i++)
    for (int j = 0; j < k; j++) scanf("%d", &a[i][j]);
  memset(can, -1, sizeof(can));
  for (int i = 0; i < k; i++) f[1 << i] = t[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++)
      if (can[j] >= 0) {
        if (!((can[j] >> j) & 1) && !((can[j] >> s[i]) & 1)) {
          f[can[j]] += a[j][s[i]];
          f[can[j] | (1 << j)] -= a[j][s[i]];
          f[can[j] | (1 << s[i])] -= a[j][s[i]];
          f[can[j] | (1 << j) | (1 << s[i])] += a[j][s[i]];
        }
        can[j] |= (1 << s[i]);
      }
    can[s[i]] = 0;
  }
  for (int i = 0; i < k; i++)
    for (int j = 0; j < 1 << k; j++)
      if ((j >> i) & 1) f[j] += f[j ^ (1 << i)];
  int ans = 0;
  for (int i = 0; i < 1 << k; i++)
    if ((i & all) == i && f[i] <= T && i != all) ans++;
  printf("%d\n", ans);
  return 0;
}
