#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  string rev;
  cin >> rev;
  int m;
  bool arr[26];
  for (int i = 0; i < 26; i++) arr[i] = 0;
  for (int i = 0; i < n; i++) {
    if (rev[i] == '*') continue;
    arr[rev[i] - 'a'] = 1;
  }
  cin >> m;
  string test;
  int res = 0;
  int defect = 0;
  int arpos[26];
  for (int i = 0; i < 26; i++) arpos[i] = 0;
  for (int j = 0; j < m; j++) {
    cin >> test;
    bool impos = 0, revealed = 1;
    bool arrtmp[26];
    for (int i = 0; i < 26; i++) arrtmp[i] = 0;
    for (int i = 0; i < n; i++) {
      if (rev[i] != '*') {
        if (rev[i] != test[i]) {
          impos = 1;
          break;
        } else
          continue;
      }
      if (arr[test[i] - 'a']) {
        impos = 1;
        break;
      }
      arrtmp[test[i] - 'a'] = 1;
    }
    if (impos) {
      defect++;
      continue;
    }
    for (int i = 0; i < 26; i++) arpos[i] += arrtmp[i];
  }
  for (int i = 0; i < 26; i++) {
    if (arpos[i] == m - defect) res++;
  }
  cout << res << endl;
  exit(0);
}
