#include <bits/stdc++.h>
using namespace std;
const int maxn = 105;
char str[maxn];
int n, m, cnt[maxn], pre[maxn];
char tmp[maxn];
bool is[maxn];
int main(void) {
  while (cin >> n) {
    memset(cnt, 0, sizeof(cnt));
    memset(is, 0, sizeof(is));
    scanf(" %s", str);
    scanf("%d", &m);
    int len = n;
    for (int i = 0; i < len; i++)
      if (str[i] != '*') is[str[i] - 'a'] = 1;
    int num = m;
    for (int k = 1; k <= m; k++) {
      scanf(" %s", tmp);
      bool ok = 1;
      for (int i = 0; i < len; i++) {
        if (str[i] != '*' && str[i] != tmp[i]) ok = 0;
        if (str[i] == '*' && is[tmp[i] - 'a']) ok = 0;
      }
      if (ok) {
        memset(pre, 0, sizeof(pre));
        for (int i = 0; i < len; i++) {
          if (str[i] == '*' && pre[tmp[i] - 'a'] == 0) {
            pre[tmp[i] - 'a'] = 1;
            cnt[tmp[i] - 'a']++;
          }
        }
      } else
        num--;
    }
    int ans = 0;
    for (int i = 0; i < maxn; i++)
      if (cnt[i] == num) ans++;
    printf("%d\n", ans);
  }
  return 0;
}
