#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-8;
const int INF = 0x3f3f3f3f;
const long long inf = 1e18;
const double pi = acos(-1.0);
const int mod = 1e9 + 7;
const int N = 1e6;
int v[50], w[55];
string a[1010];
vector<int> g;
int main() {
  int n;
  string s;
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    char j = s[i];
    if (j == '*') {
      g.push_back(i);
      w[i] = 1;
    } else
      v[j - 'a'] = 1;
  }
  int m;
  string x;
  cin >> m;
  int cnt = 0;
  while (m--) {
    cin >> x;
    int f = 1;
    for (int i = 0; i < n && f; i++) {
      if ((w[i] && v[x[i] - 'a']) || (!w[i] && x[i] != s[i])) f = 0;
    }
    if (f) a[cnt++] = x;
  }
  m = cnt;
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (v[i]) continue;
    cnt = 0;
    for (int j = 0; j < m; j++) {
      int f = 0;
      for (auto k : g) {
        if (a[j][k] - 'a' == i) f = 1;
      }
      cnt += f;
    }
    if (cnt == m) ans++;
  }
  cout << ans << endl;
  return 0;
}
