#include <bits/stdc++.h>
using namespace std;
const int MAXCHAR = 256;
bool possible(const string &s, string &t) {
  bool sit[MAXCHAR] = {};
  if (s.size() == t.size()) {
    for (int i = 0; i < (int)s.size(); ++i)
      if (s[i] != '*') {
        sit[s[i]] = 1;
        if (s[i] != t[i]) return false;
        t[i] = '-';
      }
    for (int i = 0; i < (int)s.size(); ++i)
      if (s[i] == '*' && sit[t[i]]) return false;
    return true;
  }
  return false;
}
bool inAll(const vector<string> &v, char c) {
  for (auto s : v)
    if (s.find(c) == string::npos) return false;
  return true;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  string src;
  cin >> src;
  vector<string> vl;
  string t;
  int q;
  cin >> q;
  for (int i = 0; i < q; ++i) {
    cin >> t;
    if (possible(src, t)) {
      vl.push_back(t);
    }
  }
  int cnt = 0;
  for (char i = 'a'; i <= 'z'; ++i) {
    if (src.find(i) == string::npos)
      if (inAll(vl, i)) ++cnt;
  }
  cout << cnt << endl;
  return 0;
}
