#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int m;
  cin >> m;
  vector<string> v(m);
  vector<bool> val(m, true);
  for (auto& t : v) cin >> t;
  vector<bool> char_val(26, true);
  for (auto c : s)
    if (c != '*') char_val[c - 'a'] = false;
  for (int i = 0; i < m; i++) {
    for (int j = 0; j < n; j++) {
      if (s[j] != '*' and v[i][j] != s[j]) val[i] = false;
      if (s[j] == '*' and char_val[v[i][j] - 'a'] == false) val[i] = false;
    }
  }
  int ans = 0;
  for (char c = 'a'; c <= 'z'; c++) {
    bool flag = true;
    for (int j = 0; j < m; j++)
      if (val[j]) {
        bool flag2 = false;
        for (int i = 0; i < n; i++)
          if (s[i] == '*' and v[j][i] == c) flag2 = true;
        if (!flag2) flag = false;
      }
    if (flag) ans++;
  }
  cout << ans << '\n';
  return 0;
}
