#include <bits/stdc++.h>
using namespace std;
int valid[1005];
int main() {
  int n, m;
  cin >> n;
  string hidden;
  cin >> hidden;
  cin >> m;
  string s[m + 1];
  for (int i = 1; i <= m; ++i) cin >> s[i];
  vector<int> v;
  map<char, int> mp;
  map<int, int> mp1, mp2;
  for (int i = 0; i < hidden.size(); ++i) {
    if (hidden[i] != '*') {
      mp[hidden[i]] = 1;
      mp2[i] = 1;
    } else {
      v.push_back(i);
      mp1[i] = 1;
    }
  }
  int cnt = 0;
  for (int i = 1; i <= m; ++i) {
    int flag = 0;
    for (auto it = mp.begin(); it != mp.end(); ++it) {
      for (int j = 0; j < s[i].size(); ++j) {
        if (s[i][j] == it->first && hidden[j] == it->first) {
          ;
        } else if (s[i][j] == it->first) {
          flag = 1;
        } else if (hidden[j] == it->first)
          flag = 1;
      }
    }
    if (!flag) {
      valid[i] = 1;
      cnt++;
    }
  }
  int ans = 0;
  for (int i = 'a'; i <= 'z'; ++i) {
    int tcnt = 0;
    if (mp.find(char(i)) == mp.end()) {
      for (int k = 1; k <= m; ++k) {
        if (valid[k]) {
          string ss = s[k];
          for (int j = 0; j < v.size(); ++j) {
            if (s[k][v[j]] == char(i)) {
              ++tcnt;
              break;
            }
          }
        }
      }
      if (tcnt == cnt) ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
