#include <bits/stdc++.h>
using namespace std;
int flag[200];
int cnt[200];
int main() {
  int n;
  scanf("%d", &n);
  string st;
  cin >> st;
  for (int i = 0; i < n; i++) {
    if (st[i] != '*') flag[st[i]] = 1;
  }
  int m;
  cin >> m;
  int ase = 0;
  while (m--) {
    string a;
    cin >> a;
    int f = 0;
    set<char> S;
    for (int i = 0; i < n; i++) {
      if (st[i] == '*') {
        if (flag[a[i]]) {
          f = 1;
          break;
        }
        S.insert(a[i]);
      } else {
        if (st[i] != a[i]) {
          f = 1;
          break;
        }
      }
    }
    if (f == 0) {
      for (char ch : S) cnt[ch]++;
      ase++;
    }
  }
  int ans = 0;
  for (int i = 0; i < 200; i++)
    if (cnt[i] == ase) ans++;
  cout << ans << endl;
  return 0;
}
