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