#include <bits/stdc++.h>
using namespace std;
vector<bool> was(26);
bool ok(string s, string t) {
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '*' && was[t[i] - 'a']) {
      return false;
    }
    if (s[i] != '*' && s[i] != t[i]) return false;
  }
  return true;
}
vector<string> filter(string s, vector<string> t) {
  vector<string> ret;
  for (string x : t)
    if (ok(s, x)) ret.push_back(x);
  return ret;
}
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (char c : s) {
    if (c != '*') {
      was[c - 'a'] = true;
    }
  }
  int m;
  cin >> m;
  vector<string> t(m);
  for (int i = 0; i < m; i++) {
    cin >> t[i];
  }
  t = filter(s, t);
  int ans = 0;
  for (int i = 0; i < 26; i++)
    if (!was[i]) {
      bool all = true;
      for (string x : t) {
        all &= count(x.begin(), x.end(), i + 'a') > 0;
      }
      ans += all;
    }
  cout << ans << endl;
}
