#include <bits/stdc++.h>
using namespace std;
string s, a[1005];
bool used[1001], k[1001], b[1005];
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long m, n;
  string s;
  cin >> m >> s >> n;
  for (long long i = 0; i < s.size(); ++i) {
    used[s[i]] = 1;
  }
  for (long long i = 1; i <= n; ++i) {
    cin >> a[i];
    b[i] = 1;
    for (long long j = 0; j < s.size(); ++j) {
      if (s[j] == '*') {
        if (used[a[i][j]]) b[i] = 0;
      } else {
        if (s[j] != a[i][j]) b[i] = 0;
      }
    }
  }
  long long ans = 0;
  for (auto q = 'a'; q <= 'z'; ++q) {
    if (used[q]) continue;
    long long t = 1;
    for (long long i = 1; i <= n; ++i) {
      if (b[i] == 0) continue;
      long long p = 0;
      for (long long j = 0; j < s.size(); ++j) {
        if (s[j] == '*' && used[a[i][j]]) p = 1;
        if (s[j] == '*' && a[i][j] == q) p = 1;
      }
      if (p == 0) t = 0;
    }
    if (t == 1) ans++;
  }
  cout << ans;
  return 0;
}
