#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, fl = 1;
  char st = getchar();
  while (st < '0' || st > '9') {
    if (st == '-') fl = -1;
    st = getchar();
  }
  while (st >= '0' && st <= '9') x = x * 10 + st - '0', st = getchar();
  return x * fl;
}
const int N = 2e5 + 10;
int n, k, T, tot, ans;
int t[25], v[25][25];
char st[N];
int a[N], tt;
int sta[25];
int f[1 << 25];
int main() {
  n = read();
  k = read();
  T = read();
  scanf("%s", st);
  for (int i = 0; i < n; i++) {
    a[i] = st[i] - 'A';
    tt |= (1 << a[i]);
  }
  for (int i = 0; i < k; i++) t[i] = read();
  for (int i = 0; i < k; i++)
    for (int j = 0; j < k; j++) v[i][j] = read();
  memset(sta, -1, sizeof sta);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < k; j++)
      if (sta[j] != -1) {
        if (!((sta[j] >> a[i]) & 1) && !((sta[j] >> j) & 1)) {
          f[sta[j]] += v[j][a[i]];
          f[sta[j] | (1 << j)] -= v[j][a[i]];
          f[sta[j] | (1 << a[i])] -= v[j][a[i]];
          f[sta[j] | (1 << a[i]) | (1 << j)] += v[j][a[i]];
        }
        sta[j] |= (1 << a[i]);
      }
    sta[a[i]] = 0;
  }
  for (int j = 0; j < k; j++)
    for (int i = 0; i < (1 << k); i++)
      if ((i >> j) & 1) f[i] += f[i ^ (1 << j)];
  for (int i = 0; i < (1 << k); i++)
    for (int j = 0; j < k; j++)
      if ((i >> j) & 1) f[i] += t[j];
  for (int i = 0; i < (1 << k); i++)
    if ((i & tt) == i && f[i] <= T && i != tt) ans++;
  printf("%d\n", ans);
  fclose(stdin);
  fclose(stdout);
  return 0;
}
