#include <bits/stdc++.h>
using namespace std;
int temp1[26];
int temp2[1001][26];
set<int> myset[1001];
set<int> empty;
vector<int> myvec;
int main() {
  int n;
  cin >> n;
  string str;
  cin >> str;
  int m;
  cin >> m;
  string arr[m];
  for (int i = 0; i < m; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n; i++) {
    if (str[i] != '*') {
      temp1[str[i] - 'a'] = 1;
    }
  }
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (str[j] == '*') {
        if (temp1[arr[i][j] - 'a'] == 1) {
          myset[i] = empty;
          break;
        } else {
          myset[i].insert(arr[i][j] - 'a');
          temp2[i][arr[i][j] - 'a'] = 1;
        }
      } else {
        if (str[j] != arr[i][j]) {
          myset[i] = empty;
          break;
        }
      }
    }
  }
  for (int i = 0; i < m; i++) {
    if (myset[i].empty() == false) {
      myvec.push_back(i);
    }
  }
  int ans = 0;
  int size = myvec.size();
  for (int j = 0; j < 26; j++) {
    int cnt = 0;
    for (int i = 0; i < size; i++) {
      if (temp2[myvec[i]][j] == 1) {
        cnt++;
      }
    }
    if (cnt == size) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
