#include <bits/stdc++.h>
using namespace std;
int n, k, t, b[25][25], c[200005], sum, g[25], f[1 << 22], all, a[25];
char s[200005];
signed main() {
  cin >> n >> k >> t >> s + 1;
  for (int i = 1; i <= n; i++) all |= 1 << (c[i] = s[i] - 'A');
  for (int i = 0; i < k; i++) cin >> f[1 << i];
  for (int i = 0; i < k; i++)
    for (int j = 0; j < k; j++) cin >> b[i][j];
  memset(g, -1, sizeof(g));
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j < k; j++)
      if (~g[j] && !(g[j] & (1 << c[i]))) {
        f[g[j]] += b[j][c[i]];
        f[g[j] | (1 << j)] -= b[j][c[i]];
        f[g[j] | (1 << j) | (1 << c[i])] += b[j][c[i]];
        f[g[j] |= (1 << c[i])] -= b[j][c[i]];
      }
    g[c[i]] = 0;
  }
  for (int i = 0; i < k; i++)
    for (int j = 0; j < (1 << k); j++)
      if (j & (1 << i)) f[j] += f[j ^ (1 << i)];
  for (int i = 0; i < (1 << k); i++)
    if ((i & all) == i && f[i] <= t && i != all) sum++;
  printf("%d", sum);
}
