#include <bits/stdc++.h>
using namespace std;
int n, k, T, t[26], f[1 << 23], v[26][26], s[26];
char c[200010];
int main() {
  scanf("%d%d%d", &n, &k, &T);
  scanf("%s", c + 1);
  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", v[i] + j);
  for (int i = 0; i < k; ++i) f[1 << i] = t[i];
  memset(s, -1, sizeof s);
  int S = 0;
  for (int i = 1; i <= n; ++i) {
    int x = c[i] - 'A';
    S |= (1 << x);
    for (int j = 0; j < k; ++j)
      if (~s[j]) {
        if (!(s[j] & (1 << j)) && !(s[j] & (1 << x))) {
          f[s[j]] += v[j][x];
          f[s[j] | (1 << x)] -= v[j][x];
          f[s[j] | (1 << j)] -= v[j][x];
          f[s[j] | (1 << x) | (1 << j)] += v[j][x];
        }
        s[j] |= (1 << x);
      }
    s[x] = 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)];
  int A = 0;
  for (int j = 0; j < (1 << k); ++j)
    if ((j & S) == j && f[j] <= T && (j ^ S)) A++;
  printf("%d\n", A);
}
