#include <bits/stdc++.h>
using namespace std;
vector<char> compare(string s, string t) {
  map<char, int> f;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] != '*' && s[i] != t[i]) return vector<char>();
    if (s[i] != '*') f[s[i]] += 1;
  }
  set<char> S;
  for (int i = 0; i < t.size(); i++) {
    if (s[i] == '*') {
      if (f[t[i]] > 0) return vector<char>();
      S.insert(t[i]);
    }
  }
  return vector<char>(S.begin(), S.end());
}
int main(int argc, char const* argv[]) {
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<char, int> f;
  int m;
  cin >> m;
  int cnt = 0;
  for (int i = 0; i < m; i++) {
    string t;
    cin >> t;
    vector<char> v = compare(s, t);
    if (!v.empty()) {
      ++cnt;
      for (auto j : v) {
        f[j] += 1;
      }
    }
  }
  int ans = 0;
  for (auto i : f) {
    if (i.second == cnt) ++ans;
  }
  cout << ans << endl;
  return 0;
}
