#include <bits/stdc++.h>
using namespace std;
const long long inf = (long long)1e18;
const long long mod = (long long)1e9 + 7;
const double pi = acos(-1.0);
const double eps = (double)1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};
const int N = 100500;
int n, m;
string s, a[N];
bool bad[N], was[N];
int main() {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  cin >> n >> s >> m;
  for (int i = 1; i <= m; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) was[s[i]] = true;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < n; j++) {
      if (s[j] != '*' && a[i][j] != s[j])
        bad[i] = true;
      else if (s[j] == '*' && was[a[i][j]])
        bad[i] = true;
    }
  }
  int ans = 0;
  for (int i = 'a'; i <= 'z'; i++) {
    bool good = true, found = false;
    for (int j = 0; j < n; j++) {
      if (s[j] == i) found = true;
    }
    if (found) continue;
    for (int j = 1; j <= m; j++) {
      if (bad[j]) continue;
      found = false;
      for (int k = 0; k < n; k++)
        if (a[j][k] == i) found = true;
      if (!found) good = false;
    }
    if (!good) continue;
    ans++;
  }
  cout << ans << endl;
  return 0;
}
