#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& stream, const vector<T> v) {
  stream << "[";
  for (int i = 0; i < (int)v.size(); i++) cout << v[i] << " ";
  stream << "]";
  return stream;
}
long long fpow(long long x, long long p, long long m) {
  long long r = 1;
  for (; p >>= 1;) {
    if (p & 1) r = r * x % m;
    x = x * x % m;
  }
  return r;
}
int gcd(int a, int b) {
  if (!b) return a;
  return gcd(b, a % b);
}
long long gcd(long long a, long long b) {
  if (!b) return a;
  return gcd(b, a % b);
}
int N, M;
string s, a[1010];
vector<string> cand;
bool v[30], v2[30];
int cnt[30];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  cin >> s;
  cin >> M;
  int i, j;
  for (i = 0; i < N; i++) {
    if (s[i] != '*') v[s[i] - 'a'] = 1;
  }
  for (i = 1; i <= M; i++) {
    cin >> a[i];
    bool ok = 1;
    for (j = 0; j < N; j++) {
      if (s[j] == '*' && v[a[i][j] - 'a']) ok = 0;
      if (s[j] != '*' && a[i][j] != s[j]) ok = 0;
    }
    if (ok) cand.push_back(a[i]);
  }
  for (string s : cand) {
    memset(v2, 0, sizeof(v2));
    for (i = 0; i < N; i++) v2[s[i] - 'a'] = 1;
    for (i = 0; i < 26; i++)
      if (v2[i]) cnt[i]++;
  }
  int res = 0;
  for (i = 0; i < 26; i++)
    if (cnt[i] == (int)cand.size() && !v[i]) res++;
  cout << res << "\n";
  return 0;
}
