#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
long long powmod(long long a, long long b) {
  long long res = 1;
  a %= mod;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
  }
  return res;
}
int n, m, mask;
char s[110], t[110];
int main() {
  scanf("%d", &n);
  scanf("%s", s);
  for (int i = 0; i < n; i++)
    if (s[i] != '*') mask |= (1 << (s[i] - 'a'));
  scanf("%d", &m);
  int mask2 = ((1 << 26) - 1) ^ mask;
  for (int i = 0; i < m; i++) {
    scanf("%s", t);
    bool val = 1;
    for (int i = 0; i < n; i++)
      if (s[i] == '*' && (mask & (1 << (t[i] - 'a')))) {
        val = 0;
        break;
      }
    for (int i = 0; i < n; i++)
      if (s[i] != '*' && t[i] != s[i]) {
        val = 0;
        break;
      }
    if (val) {
      int mk = 0;
      for (int i = 0; i < n; i++) mk |= (1 << (t[i] - 'a'));
      mask2 &= mk;
    }
  }
  printf("%d\n", __builtin_popcount(mask2));
}
