#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int lol[1020][26];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  string word;
  cin >> word;
  long long m;
  cin >> m;
  string s[m];
  for (int i = 0; i < m; i++) cin >> s[i];
  map<char, int> mp;
  for (int i = 0; i < m; i++) {
    string x = s[i];
    for (int j = 0; j < x.length(); j++) {
      if (word[j] != '*' && x[j] != word[j]) {
        s[i] = "";
        break;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    mp[word[i]] = -1;
  }
  for (int i = 0; i < m; i++) {
    string x = s[i];
    for (int j = 0; j < x.length(); j++) {
      if (word[j] == '*' && mp[x[j]] == -1) {
        s[i] = "";
        break;
      }
    }
  }
  for (int i = 0; i < m; i++) {
    string x = s[i];
    if (s[i] == "") continue;
    for (int j = 0; j < x.length(); j++) {
      if (word[j] == '*') {
        lol[i][x[j] - 97]++;
      }
    }
  }
  long long ans = 0;
  for (int j = 0; j < 26; j++) {
    int flag = 1;
    for (int i = 0; i < m; i++) {
      if (s[i] == "") continue;
      if (lol[i][j] > 0)
        flag = 1;
      else {
        flag = 0;
        break;
      }
    }
    if (flag == 1) ans++;
  }
  cout << ans << endl;
}
