#include <bits/stdc++.h>
using namespace std;
int a[26], m[1001][26];
int ans[55];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<string> ss;
  int t = 1;
  while (t--) {
    int n;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
      if (s[i] != '*') a[s[i] - 'a']++;
    }
    int m;
    cin >> m;
    for (int i = 0; i < m; i++) {
      string s1;
      cin >> s1;
      int dis = 1;
      for (int k = 0; k < n; k++) {
        if (s[k] == '*') {
          if (a[s1[k] - 'a'] != 0) dis = 0;
        }
        if (s[k] != '*' && s[k] != s1[k]) dis = 0;
      }
      if (dis == 1) ss.push_back(s1);
    }
    m = ss.size();
    if (m == 0) {
      cout << 0;
      return 0;
    }
    set<char> ana[m];
    set<char>::iterator it;
    for (int i = 0; i < m; i++) {
      for (int k = 0; k < n; k++) {
        if (s[k] == '*') ana[i].insert(ss[i][k]);
      }
    }
    int cnn = 0;
    for (int p = 0; p < 26; p++) {
      char c = 'a' + p;
      int ff = 1;
      for (int i = 0; i < m; i++) {
        int findd = 0;
        for (it = ana[i].begin(); it != ana[i].end(); it++) {
          if (*it == c) findd = 1;
        }
        if (findd == 0) ff = 0;
      }
      if (ff == 1) cnn++;
    }
    cout << cnn;
  }
}
