#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i;
  cin >> n;
  int freq[26] = {0};
  string s;
  cin >> s;
  for (i = 0; i < s.size(); i++) {
    if (s[i] != '*') freq[s[i] - 'a']++;
  }
  int t;
  cin >> t;
  int freq1[26] = {0};
  int flag = 0;
  int count = 0;
  string temp;
  bool visited[26] = {false};
  for (int p = 0; p < t; p++) {
    cin >> temp;
    flag = 0;
    for (i = 0; i < 26; i++) visited[i] = false;
    for (i = 0; i < s.size(); i++) {
      if (s[i] != '*' && s[i] != temp[i]) {
        flag = 1;
        count++;
        break;
      }
      if (s[i] == '*' && freq[temp[i] - 'a'] > 0) {
        flag = 1;
        count++;
        break;
      }
    }
    if (flag == 0) {
      for (i = 0; i < s.size(); i++) {
        if (s[i] == '*' && !visited[temp[i] - 'a']) {
          freq1[temp[i] - 'a']++;
          visited[temp[i] - 'a'] = true;
        }
      }
    }
  }
  int ans = 0;
  for (i = 0; i < 26; i++) {
    if (freq1[i] >= t - count) ans++;
  }
  cout << ans << endl;
  return 0;
}
