#include <bits/stdc++.h>
using namespace std;
bool Matches(const string& w, const string& s, const vector<bool>& rev) {
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] == '*') {
      if (rev[w[i] - 'a']) return false;
    } else {
      if (s[i] != w[i]) return false;
    }
  }
  return true;
}
void Filter(const string& w, vector<bool>& can) {
  vector<bool> has(26);
  for (int i = 0; i < w.length(); ++i) {
    has[w[i] - 'a'] = true;
  }
  for (int i = 0; i < 26; ++i) {
    if (!has[i]) can[i] = false;
  }
}
void Solve() {
  int n;
  string s;
  cin >> n >> s;
  vector<bool> revealed(26);
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] != '*') revealed[s[i] - 'a'] = true;
  }
  vector<bool> can(26, true);
  for (int i = 0; i < 26; ++i) {
    can[i] = !revealed[i];
  }
  int m;
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    string w;
    cin >> w;
    if (Matches(w, s, revealed)) {
      Filter(w, can);
    }
  }
  int cnt = 0;
  for (int i = 0; i < 26; ++i) {
    cnt += can[i];
  }
  cout << cnt << "\n";
}
int main() {
  int tests = 1;
  for (; tests; --tests) {
    Solve();
  }
}
