#include <bits/stdc++.h>
using namespace std;
int n, num, ans, m;
bool flag[26], vis[26];
int cnt[26];
char s[110], s1[110];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  for (int i = 1; i <= n; i++)
    if (s[i] != '*') flag[s[i] - 'a'] = 1;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%s", s1 + 1);
    bool w = 1;
    for (int j = 1; j <= n; j++)
      if (s[j] != '*' && s[j] != s1[j]) w = 0;
    for (int j = 1; j <= n; j++)
      if (s[j] == '*' && flag[s1[j] - 'a']) w = 0;
    if (!w) continue;
    ans++;
    memset(vis, 0, sizeof(vis));
    for (int j = 1; j <= n; j++)
      if (s[j] == '*') vis[s1[j] - 'a'] = 1;
    for (int j = 0; j < 26; j++) cnt[j] += vis[j];
  }
  int ANS = 0;
  for (int i = 0; i < 26; i++)
    if (cnt[i] == ans) ANS++;
  printf("%d\n", ANS);
  return 0;
}
