#include <bits/stdc++.h>
using namespace std;
const int maxn = 200010;
int del[22], a[22][22], p[1 << 22], lnk[maxn][22];
char st[maxn];
int main() {
  int n, m, t;
  scanf("%d%d%d", &n, &m, &t);
  int v = 0;
  scanf("%s", st);
  for (int i = 0; i < n; i++) v |= 1 << st[i] - 'A';
  for (int i = 0; i < m; i++) scanf("%d", &del[i]);
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  memset(lnk, -1, sizeof(lnk));
  for (int i = 1; i < n; i++)
    for (int j = 0; j < m; j++)
      if (st[i - 1] - 'A' == j)
        lnk[i][j] = i - 1;
      else
        lnk[i][j] = lnk[i - 1][j];
  memset(p, 0, sizeof(p));
  for (int i = 1; i < n; i++) {
    int tot = 0;
    pair<int, int> c[30];
    for (int j = 0; j < m; j++)
      if (lnk[i][j] != -1) c[tot++] = make_pair(-lnk[i][j], j);
    sort(c, c + tot);
    int tmp = 0;
    for (int j = 0; j < tot; j++) {
      int ret = a[c[j].second][st[i] - 'A'];
      p[tmp] += ret;
      p[tmp | 1 << st[i] - 'A'] -= ret;
      p[tmp | 1 << c[j].second] -= ret;
      p[tmp | 1 << st[i] - 'A' | 1 << c[j].second] += ret;
      if (c[j].second == st[i] - 'A') break;
      tmp |= 1 << c[j].second;
    }
  }
  for (int j = 0; j < m; j++)
    for (int i = (1 << m) - 1; i >= 0; i--)
      if (!(i >> j & 1)) p[i | 1 << j] += p[i];
  int res = 0;
  for (int i = 0; i < 1 << m; i++) {
    if ((v | i) != v || v == i) continue;
    int ret = p[i];
    for (int j = 0; j < m; j++)
      if (i >> j & 1) ret += del[j];
    res += ret <= t;
  }
  printf("%d\n", res);
  return 0;
}
