#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
void solve() {
  long long n, m, f = 1;
  cin >> n;
  string w;
  cin >> w;
  set<char> sett1;
  for (long long i = 0; i < w.length(); i++) {
    if (w[i] != '*') sett1.insert(w[i]);
  }
  cin >> m;
  string t;
  vector<string> words;
  for (long long i = 0; i < m; i++) {
    f = 1;
    cin >> t;
    for (long long j = 0; j < n; j++) {
      if (w[j] != '*' and w[j] != t[j]) {
        f = 0;
        break;
      } else if (w[j] == '*') {
        if (sett1.find(t[j]) != sett1.end()) {
          f = 0;
          break;
        }
      }
    }
    if (f) words.push_back(t);
  }
  long long ans = 0;
  for (long long i = 0; i < 26; i++) {
    set<long long> sett;
    for (long long k = 0; k < n; k++) {
      if (w[k] == '*') {
        for (long long j = 0; j < words.size(); j++) {
          if (words[j][k] == i + 97) sett.insert(j);
        }
      }
    }
    if (sett.size() == words.size() and words.size() != 0) ans += 1;
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
