#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
const int M = 55;
int n, m;
char hid[M], a[N][M];
bool forbid[N], showed[M];
int main() {
  scanf("%d", &m);
  scanf("%s", hid);
  for (int j = 0; j < m; j++)
    if (hid[j] != '*') showed[hid[j] - 'a'] = 1;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%s", a[i]);
    for (int j = 0; j < m; j++) {
      if (hid[j] != '*' && a[i][j] != hid[j]) forbid[i] = 1;
      if (hid[j] == '*' && showed[a[i][j] - 'a']) forbid[i] = 1;
    }
  }
  int ans = 0;
  for (char cur = 'a'; cur <= 'z'; cur++) {
    if (showed[cur - 'a']) continue;
    bool ok = 1;
    for (int i = 0; i < n; i++) {
      if (forbid[i]) continue;
      bool show = 0;
      for (int j = 0; j < m; j++) show |= (a[i][j] == cur);
      if (!show) ok = 0;
    }
    ans += ok;
  }
  cout << ans << endl;
  return 0;
}
