#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 100;
const int bl = 330;
const double eps = 1e-12;
string temp, dict[maxn];
int n, m;
bool used[30], bad[maxn];
multiset<string> nDict;
vector<char> res;
vector<string> nnDict;
bool badCheck(string cur) {
  for (int i = 0; i < n; ++i)
    if (temp[i] == '*' && used[cur[i] - 'a']) return 1;
  return 0;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> temp;
  cin >> m;
  for (int i = 0; i < m; ++i) cin >> dict[i];
  for (int i = 0; i < n; ++i) used[temp[i] - 'a'] = (temp[i] != '*');
  for (int i = 0; i < m; ++i) {
    bool eqtemp = 1;
    for (int j = 0; j < n; ++j) {
      if (temp[j] != '*') {
        if (dict[i][j] == temp[j]) continue;
        eqtemp = 0;
      }
    }
    if (eqtemp) nDict.insert(dict[i]);
  }
  for (set<string>::iterator it1 = nDict.begin(); it1 != nDict.end(); ++it1) {
    string cur = "";
    for (int i = 0; i < n; ++i) cur += (*it1)[i];
    if (!badCheck(cur)) nnDict.push_back(*it1);
  }
  int newN = nnDict.size();
  if (newN == 0) return cout << 0 << endl, 0;
  for (int i = 0; i < 26; ++i) {
    if (!used[i]) {
      int cnt = 0;
      for (int j = 0; j < nnDict.size(); ++j) {
        bool found = 0;
        for (int k = 0; k < n; ++k)
          if (temp[k] == '*' && nnDict[j][k] == char(i + 'a')) found = 1;
        cnt += found;
      }
      if (cnt == newN) res.push_back(char(i + 'a'));
    }
  }
  cout << res.size() << endl;
  return 0;
}
