#include <bits/stdc++.h>
using namespace std;
string mask;
bool check_mask(string s) {
  set<char> used;
  for (int j = 0; j < s.length(); ++j) {
    if (mask[j] != '*') used.insert(mask[j]);
    if (mask[j] != '*' && mask[j] != s[j]) return false;
  }
  for (int j = 0; j < s.length(); ++j) {
    if (mask[j] == '*' && used.find(s[j]) != used.end()) return false;
  }
  return true;
}
int main() {
  int n, m;
  cin >> n;
  cin >> mask;
  vector<string> kss;
  cin >> m;
  for (int i = 0; i < m; ++i) {
    string s;
    cin >> s;
    if (check_mask(s)) kss.push_back(s);
  }
  set<char> used;
  for (int i = 0; i < n; ++i)
    if (mask[i] != '*') used.insert(mask[i]);
  vector<set<char>> se;
  for (int j = 0; j < kss.size(); ++j) {
    set<char> temp;
    for (int i = 0; i < n; ++i) {
      if (used.find(kss[j][i]) == used.end()) {
        temp.insert(kss[j][i]);
      }
    }
    if (!temp.empty()) se.push_back(temp);
  }
  string abc = "abcdefghijklmnopqrstuvwxyz";
  vector<int> count(26, 0);
  for (int t = 0; t < 26; ++t) {
    for (int j = 0; j < se.size(); ++j) {
      if (se[j].find(abc[t]) != se[j].end()) {
        ++count[t];
      } else {
        count[t] = -1;
        break;
      }
    }
  }
  int ans = 0;
  for (int a : count) {
    if (a == se.size()) ++ans;
  }
  cout << ans << endl;
  return 0;
}
