#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n, m;
  cin >> n;
  string s, str;
  cin >> s;
  map<char, bool> temp;
  vector<string> v;
  for (int i = 0; i < n; i++) temp[s[i]] = true;
  cin >> m;
  map<char, int> track;
  for (int k = 0; k < m; k++) {
    cin >> str;
    string t = "";
    bool flag = true;
    for (int i = 0; i < n; i++) {
      if (s[i] != '*' && s[i] != str[i]) {
        flag = false;
        break;
      } else if (s[i] == '*' && temp[str[i]]) {
        flag = false;
        break;
      } else if (s[i] == '*')
        t += str[i];
    }
    if (flag) v.push_back(t);
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    char ch = 97 + i;
    int count = 0;
    for (int j = 0; j < v.size(); j++) {
      for (int k = 0; k < v[j].length(); k++) {
        if (v[j][k] == ch) {
          count++;
          break;
        }
      }
    }
    if (count == v.size()) ans++;
  }
  cout << ans << endl;
  return 0;
}
