#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  set<string> cc;
  long long n;
  cin >> n;
  string s;
  cin >> s;
  long long k;
  cin >> k;
  string t;
  for (long long i = 0; i < k; i++) {
    cin >> t;
    cc.insert(t);
  }
  set<char> rev;
  for (long long i = 0; i < n; i++) {
    if (s[i] != '*') {
      rev.insert(s[i]);
      set<string> nc;
      for (auto x : cc) {
        if (x[i] == s[i]) nc.insert(x);
      }
      cc = nc;
    }
  }
  for (long long i = 0; i < n; i++) {
    if (s[i] == '*') {
      set<string> nc;
      for (auto x : cc) {
        if (rev.find(x[i]) == rev.end()) nc.insert(x);
      }
      cc = nc;
    }
  }
  set<char> g;
  for (long long i = 0; i < n; i++) {
    if (s[i] == '*') {
      for (auto x : cc) {
        g.insert(x[i]);
      }
    }
  }
  long long ans = 0;
  for (auto y : g) {
    long long curc = 0;
    for (auto x : cc) {
      long long fl = 0;
      for (long long i = 0; i < x.size(); i++) {
        if (x[i] == y) fl = 1;
      }
      if (fl) curc++;
    }
    if (curc == cc.size()) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
