#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int inf = 1e9;
const int N = 1e6 + 1;
int f[27];
int cnt[1100][27];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, m, i, j, flag;
  string str;
  string s[1100];
  string ops = "abcdefghijklmnopqrstuvwxyz";
  cin >> n;
  cin >> str;
  cin >> m;
  for (i = 0; i < m; i++) {
    cin >> s[i];
  }
  int len = 0;
  for (i = 0; i < n; i++) {
    if (str[i] != '*') {
      f[str[i] - 'a'] = 1;
    } else {
      len++;
    }
  }
  int cnt1 = 0;
  for (i = 0; i < m; i++) {
    flag = 1;
    for (j = 0; j < n; j++) {
      if (str[j] != '*' && str[j] != s[i][j]) {
        flag = 0;
        break;
      }
      if (str[j] == '*' && f[s[i][j] - 'a'] == 1) {
        flag = 0;
        break;
      }
    }
    if (flag) {
      s[cnt1++] = s[i];
    }
  }
  m = cnt1;
  cnt1 = 0;
  string temp = "";
  for (i = 0; i < m; i++) {
    temp = "";
    for (j = 0; j < n; j++) {
      if (!f[s[i][j] - 'a']) {
        temp += s[i][j];
      } else {
      }
    }
    if (temp == "") {
    } else {
      assert(temp.length() == len);
      s[cnt1++] = temp;
      for (j = 0; j < s[cnt1 - 1].length(); j++) {
        cnt[cnt1 - 1][s[cnt1 - 1][j] - 'a']++;
      }
    }
  }
  if (cnt1 == 0) {
    cout << "0", cout << "\n";
    return 0;
  }
  int ans = 0;
  for (i = 0; i < 26; i++) {
    if (!f[i]) {
      flag = 1;
      for (j = 0; j < cnt1; j++) {
        if (cnt[j][i] == 0) {
          flag = 0;
          break;
        }
      }
      if (flag) {
        ans++;
      }
    }
  }
  cout << ans, cout << "\n";
  return 0;
}
