#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
int n, m;
vector<string> dic;
string msk;
bool used[MAXN];
void solve() {
  cin >> n;
  cin >> msk;
  for (int i = 0; i < n; ++i) {
    if (msk[i] != '*') used[msk[i]] = true;
  }
  cin >> m;
  for (int i = 0; i < m; ++i) {
    string s;
    cin >> s;
    bool bad = true;
    for (int j = 0; j < n; ++j) bad = bad & used[s[j]];
    for (int j = 0; j < n; ++j) {
      if (msk[j] == '*' && used[s[j]]) bad = true;
      if (msk[j] != '*' && msk[j] != s[j]) bad = true;
    }
    if (bad) continue;
    dic.push_back(s);
  }
  int ans = 0;
  for (char ch = 'a'; ch <= 'z'; ++ch) {
    if (used[ch]) continue;
    bool inall = true;
    for (int j = 0; j < (int)dic.size(); ++j) {
      bool has = false;
      for (int i = 0; i < (int)dic[j].length(); ++i)
        if (dic[j][i] == ch) has = true;
      inall = inall & has;
    }
    ans += inall;
  }
  cout << ans;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
