#include <bits/stdc++.h>
using namespace std;
int n, m, t, ans;
char s[200010];
int a[30][30], q[30], b[30], qn;
long long sum[1 << 22];
int main() {
  scanf("%d%d%d%s", &n, &m, &t, s);
  for (int i = 0; i < m; i++) scanf("%d", &b[i]);
  for (int i = 0; i < m; i++)
    for (int j = 0; j < m; j++) scanf("%d", &a[i][j]);
  qn = 0;
  for (int i = 0; i < n; i++) {
    int v = s[i] - 'A', st = 0, j;
    for (j = 0; j < qn; j++) {
      int k = q[j];
      sum[st] += a[k][v];
      sum[st | (1 << k)] -= a[k][v];
      sum[st | (1 << v)] -= a[k][v];
      sum[st | (1 << v) | (1 << k)] += a[k][v];
      if (k == v) break;
      st |= (1 << k);
    }
    if (j == qn) qn++;
    for (; j; j--) q[j] = q[j - 1];
    q[0] = v;
  }
  for (int i = 0; i < m; i++)
    for (int j = 0; j < (1 << m); j++)
      if (!(j & (1 << i))) sum[j | (1 << i)] += sum[j];
  int st = 0;
  for (int i = 0; i < n; i++) st |= (1 << s[i] - 'A');
  for (int i = 0; i < m; i++)
    if (st & (1 << i))
      for (int j = 0; j < (1 << m); j++)
        if (j & (1 << i)) sum[j] += b[i];
  ans = 0;
  for (int j = 0; j < (1 << m); j++) {
    int k = (1 << m) - 1 - j;
    if ((st & k) == k && k > 0 && sum[j] <= t) ans++;
  }
  printf("%d\n", ans);
  return 0;
}
