#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, M = 25, MM = 1 << M;
int n, k, T, b[M], f[MM], a[M][M], sum, ans;
char s[N];
inline int read() {
  int x = 0, k = 1;
  char c = getchar();
  for (; c < 48 || c > 57; c = getchar()) k ^= (c == '-');
  for (; c >= 48 && c <= 57; c = getchar()) x = x * 10 + (c ^ 48);
  return k ? x : -x;
}
int main() {
  memset(b, -1, sizeof(b));
  n = read(), k = read(), T = read();
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++) sum |= (1 << (s[i] - 'A'));
  for (int i = 1; i <= k; i++) f[1 << (i - 1)] = read();
  for (int i = 1; i <= k; i++)
    for (int j = 1; j <= k; j++) a[i][j] = read();
  for (int i = 1; i <= n; i++) {
    int now = s[i] - 'A';
    for (int j = 0; j < k; j++)
      if (b[j] >= 0) {
        int x = b[j];
        if (!((x >> j) & 1) && !((x >> now) & 1)) {
          int de = a[j + 1][now + 1];
          f[x] += de;
          f[x | (1 << j)] -= de;
          f[x | (1 << now)] -= de;
          f[x | (1 << j) | (1 << now)] += de;
        }
        b[j] |= (1 << now);
      }
    b[now] = 0;
  }
  for (int i = 1; i <= k; i++)
    for (int j = 0; j < (1 << k); j++)
      if ((j >> (i - 1)) & 1) f[j] += f[j ^ (1 << (i - 1))];
  for (int i = 0; i < 1 << k; i++)
    if ((i & sum) == i && f[i] <= T && i != sum) ans++;
  printf("%d\n", ans);
  return 0;
}
