#include <bits/stdc++.h>
using namespace std;
int main() {
  int ans[30], tans[30], flot[30];
  memset(flot, 0, sizeof(flot));
  memset(ans, 0x3f3f3f3f, sizeof(ans));
  int n, num[55], top = 0, m;
  string s, s1;
  cin >> n;
  cin >> s;
  for (int i = 0; i < n; i++) {
    if (s[i] == '*')
      num[top++] = i;
    else {
      flot[s[i] - 'a'] = 1;
      ans[s[i] - 'a'] = 0;
    }
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int tt = 0;
    memset(tans, 0, sizeof(tans));
    cin >> s1;
    for (int i = 0; i < top; i++) {
      if (flot[s1[num[i]] - 'a'] == 1) {
        tt = 1;
        break;
      }
      tans[s1[num[i]] - 'a']++;
    }
    for (int i = 0; i < n; i++) {
      if (s[i] == '*') continue;
      if (s[i] != s1[i]) {
        tt = 1;
        break;
      }
    }
    if (tt) continue;
    for (int i = 0; i < 30; i++) ans[i] = min(ans[i], tans[i]);
  }
  int je = 0;
  for (int i = 0; i < 30; i++)
    if (ans[i] != 0) je++;
  cout << je << endl;
  return 0;
}
