#include <bits/stdc++.h>
using namespace std;
const int N = 200000, M = 22;
void FWT_or(unsigned int *a, int n, int t) {
  for (int i = 1; i < n; i <<= 1)
    for (int j = 0; j < n; j += i << 1)
      for (int k = 0; k < i; ++k)
        t ? a[i + j + k] -= a[j + k] : a[i + j + k] += a[j + k];
}
int n, m;
unsigned int lim;
char str[N + 9];
unsigned int a[M + 9], b[M + 9][M + 9];
void into() {
  scanf("%d%d%u%s", &n, &m, &lim, str + 1);
  for (int i = 0; i < m; ++i) scanf("%u", &a[i]);
  for (int i = 0; i < m; ++i)
    for (int j = 0; j < m; ++j) scanf("%u", &b[i][j]);
}
unsigned int cnt[(1 << M) + 9];
int last[M + 9], ord[M + 9];
bool cmp(const int &a, const int &b) { return last[a] > last[b]; }
void Get_cnt() {
  for (int i = 1; i <= n; ++i) {
    int co = 0, t = str[i] - 'A';
    for (int j = 0; j < m; ++j)
      if (last[j]) ord[co++] = j;
    sort(ord, ord + co, cmp);
    int now = 0;
    for (int j = 0; j < co; ++j) {
      int p = ord[j];
      unsigned int v = b[p][t];
      cnt[now] += v;
      cnt[now | 1 << p] -= v;
      cnt[now | 1 << t] -= v;
      cnt[now | 1 << t | 1 << p] += v;
      now |= 1 << p;
      if (p == t) break;
    }
    last[t] = i;
  }
  FWT_or(cnt, 1 << m, 0);
}
int vis[M + 9], ans;
void Get_ans() {
  for (int i = 1; i <= n; ++i) ++vis[str[i] - 'A'];
  for (int s = 1; s < 1 << m; ++s) {
    int cs = (1 << m) - 1 ^ s, flag = 0, sum = 0;
    for (int i = 0; i < m; ++i)
      if (cs >> i & 1) {
        sum += vis[i];
        if (!vis[i]) {
          flag = 1;
          break;
        }
      }
    if (flag || sum == n) continue;
    if (cnt[cs] > lim) continue;
    for (int i = 0; i < m; ++i)
      if (cs >> i & 1) cnt[cs] += a[i];
    if (cnt[cs] > lim) continue;
    ++ans;
  }
}
void work() {
  Get_cnt();
  Get_ans();
}
void outo() { printf("%d\n", ans); }
int main() {
  into();
  work();
  outo();
  return 0;
}
