#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int fl[27], h;
int tot;
set<int> ar[27];
int main() {
  int n, m, ans;
  string s, ss;
  while (cin >> n) {
    cin >> ss;
    memset(fl, 0, sizeof fl);
    for (int i = 0; i < 27; i++) ar[i].clear();
    for (char c : ss) {
      if (c == '*') continue;
      fl[c - 'a'] = 1;
    }
    tot = 0;
    cin >> m;
    for (int i = 0; i < m; i++) {
      cin >> s;
      h = 1;
      for (int j = 0; j < n; j++) {
        char c = s[j];
        if (ss[j] != '*' && ss[j] != s[j]) {
          h = 0;
          break;
        } else if (ss[j] == '*' && fl[c - 'a'] == 1) {
          h = 0;
          break;
        }
      }
      if (h) {
        tot++;
        for (char c : s) {
          ar[c - 'a'].insert(i);
        }
      }
    }
    ans = 0;
    for (int i = 0; i < 26; i++) {
      if (!fl[i] && ar[i].size() == tot) {
        ans++;
      }
    }
    cout << ans << "\n";
  }
  return 0;
}
