#include <bits/stdc++.h>
using namespace std;
int n, m, h[1002], b[1002], ans;
char s[1002], t[1002], a[1002][1002];
int stcmp(char* s, char* t) {
  for (int i = 0; i < n; ++i)
    if (s[i] != t[i]) return 0;
  return 1;
}
int main() {
  scanf("%d\n", &n);
  scanf("%s\n%d\n", s, &m);
  for (int i = 1; i <= m; ++i) scanf("%s\n", a[i]);
  for (int i = 0; i < n; ++i) {
    if (s[i] != '*') h[s[i] - 'a']++;
  }
  for (int i = 1; i <= m; ++i) {
    for (int j = 0; j < n; ++j) {
      if (h[a[i][j] - 'a'])
        t[j] = a[i][j];
      else
        t[j] = '*';
    }
    if (stcmp(s, t))
      b[i] = 1;
    else
      b[i] = 0;
  }
  int anc = 0, ani = 0;
  ans = 0;
  for (int k = 0; k < 26; ++k) {
    anc = ani = 0;
    if (h[k]) continue;
    for (int i = 1; i <= m; ++i) {
      if (!b[i]) continue;
      anc = 0;
      for (int j = 0; j < n; ++j) {
        if (h[a[i][j] - 'a']) continue;
        if (s[j] == '*' && a[i][j] - 'a' == k) {
          anc = 1;
          break;
        }
      }
      if (!anc) {
        ani = 1;
        break;
      }
    }
    if (!ani) ans++;
  }
  printf("%d", ans);
  return 0;
}
