#include <bits/stdc++.h>
#pragma GCC optimize("3", "Ofast", "inline")
using namespace std;
inline long long read() {
  long long x = 0;
  char ch = getchar();
  bool f = 0;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = 1;
  for (; isdigit(ch); ch = getchar()) x = x * 10 + ch - '0';
  return f ? -x : x;
}
void write(long long x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) write(x / 10);
  putchar(x % 10 + '0');
}
void writeln(long long x) {
  write(x);
  putchar('\n');
}
void writep(long long x) {
  write(x);
  putchar(' ');
}
long long const N = 2e5 + 3;
long long const M = 25;
long long const MAX = (1 << 22) + 3;
long long n, m, t, all, ans, a[M], b[M][M], last[M], f[MAX];
char s[N];
pair<long long, long long> p[M];
signed main() {
  n = read();
  m = read();
  t = read();
  scanf("%s", s + 1);
  for (long long i = 1; i <= n; i++) all |= (1 << (s[i] - 'A'));
  for (long long i = 0; i < m; i++) a[i] = read();
  for (long long i = 0; i < m; i++)
    for (long long j = 0; j < m; j++) b[i][j] = read();
  for (long long i = 0; i < m; i++) f[1 << i] = a[i];
  for (long long i = 0; i < m; i++) last[i] = n + 1;
  for (long long i = n; i; i--) {
    for (long long j = 0; j < m; j++) p[j] = make_pair(last[j], j);
    sort(p, p + m);
    long long tmp = 0;
    for (long long j = 0; j < m; j++) {
      if (p[j].first >= n + 1) break;
      long long x = s[i] - 'A', y = p[j].second;
      f[tmp] += b[x][y];
      f[tmp | (1 << x)] -= b[x][y];
      f[tmp | (1 << y)] -= b[x][y];
      f[tmp | (1 << x) | (1 << y)] += b[x][y];
      if (x == y) break;
      tmp |= (1 << y);
    }
    last[s[i] - 'A'] = i;
  }
  for (long long i = 0; i < m; i++)
    for (long long j = 0; j < (1 << m); j++)
      if (j & (1 << i)) f[j] += f[j ^ (1 << i)];
  for (long long i = 0; i < (1 << m); i++)
    if ((i & all) == i && i != all && f[i] <= t) ans++;
  writeln(ans);
  return 0;
}
