#include <bits/stdc++.h>
using namespace std;
string S, s;
int cnt, tot, ans[1000], appear[1000], del[1000], tmp[1000];
int main() {
  int l;
  scanf("%d", &l);
  cin >> S;
  for (int i = (0); i <= (l - 1); ++i)
    if (S[i] != '*') appear[S[i] - 'a'] = 1;
  int n;
  scanf("%d", &n);
  for (int i = (1); i <= (n); ++i) {
    int flag = 0;
    cin >> s;
    for (int i = (0); i <= (25); ++i) tmp[i] = 0;
    for (int i = (0); i <= (l - 1); ++i) {
      if (S[i] != '*' && s[i] != S[i]) {
        flag = 0;
        break;
      }
      if (S[i] == '*' && appear[s[i] - 'a']) {
        flag = 0;
        break;
      }
      if (S[i] == '*') flag = 1, tmp[s[i] - 'a'] = 1;
    }
    if (flag) {
      ++tot;
      for (int i = (0); i <= (25); ++i) ans[i] += tmp[i];
    }
  }
  for (int i = (0); i <= (25); ++i)
    if (ans[i] == tot) cnt++;
  printf("%d\n", cnt);
  return 0;
}
