#include <bits/stdc++.h>
using namespace std;
int i, j, k, n, m, l, y, p, f[26], o[26], t[26];
string s, s1;
int main() {
  cin >> n;
  cin >> s1;
  for (i = 0; i < n; i++)
    if (s1[i] != '*') o[s1[i] - 'a'] = 1;
  cin >> m;
  y = m;
  for (i = 1; i <= m; i++) {
    cin >> s;
    p = 1;
    for (j = 0; j < 26; j++) t[j] = 0;
    for (j = 0; j < n; j++) {
      t[s[j] - 'a'] = 1;
      if (o[s[j] - 'a'] && s1[j] == '*' || s1[j] != '*' && s1[j] != s[j]) p = 0;
    }
    if (p == 1)
      for (j = 0; j < 26; j++) f[j] += t[j];
    else
      y--;
  }
  if (y > 0)
    for (i = 0; i < 26; i++)
      if (!o[i] && f[i] == y) l++;
  cout << l << endl;
}
