#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  int m;
  cin >> m;
  vector<string> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  int alp[26];
  for (int i = 0; i < 26; i++) {
    alp[i] = 0;
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == '*') {
      continue;
    }
    alp[s[i] - 'a'] = 1;
  }
  vector<int> star;
  for (int i = 0; i < n; i++) {
    if (s[i] == '*') {
      star.push_back(i);
    }
  }
  int cnt = 0;
  for (int i = 0; i < star.size(); i++) {
    for (int j = 0; j < m; j++) {
      if (a[j] == "\0") {
        continue;
      }
      if (alp[a[j][star[i]] - 'a'] == 1) {
        a[j] = "\0";
        cnt++;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] != '*') {
      for (int j = 0; j < m; j++) {
        if (a[j] == "\0") {
          continue;
        }
        if (a[j][i] != s[i]) {
          a[j] = "\0";
          cnt++;
        }
      }
    }
  }
  for (int i = 0; i < 26; i++) {
    alp[i] = 0;
  }
  int p = 0;
  for (int i = 0; i < m; i++) {
    if (a[i] != "\0") {
      p++;
      for (int j = 0; j < star.size(); j++) {
        if (alp[a[i][star[j]] - 'a'] == p - 1) {
          alp[a[i][star[j]] - 'a'] = p;
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (alp[i] == p) {
      ans++;
    }
  }
  cout << ans << endl;
}
