#include <bits/stdc++.h>
using namespace std;
int idx(char c) { return c - 'a'; }
bool vis[26];
char str[55];
bool used[26];
int num[26];
vector<string> vec;
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", str);
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    if (str[i] != '*') vis[idx(str[i])] = 1;
  }
  int len = strlen(str);
  int m;
  scanf("%d", &m);
  string tmp;
  for (int i = 0; i < m; i++) {
    tmp.clear();
    cin >> tmp;
    bool flag = 1;
    for (int j = 0; j < len; j++) {
      if ((str[j] == '*' && vis[idx(tmp[j])] == 1) ||
          str[j] != '*' && str[j] != tmp[j]) {
        flag = 0;
        break;
      }
    }
    if (flag) vec.push_back(tmp);
  }
  for (int i = 0; i < vec.size(); i++) {
    tmp = vec[i];
    for (int j = 0; j < len; j++) {
      if (str[j] == '*' && used[idx(tmp[j])] == 0) {
        used[idx(tmp[j])] = 1;
        num[idx(tmp[j])]++;
      }
    }
    memset(used, 0, sizeof(used));
  }
  int cnt = vec.size();
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (num[i] == cnt) ans++;
  }
  cout << ans << endl;
  return 0;
}
