#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e8;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, m, ans, res;
string t;
bool bad[500];
vector<string> second;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  cin >> n;
  cin >> t;
  cin >> m;
  for (int i = 0; i < n; ++i) {
    if (t[i] != '*') bad[t[i] - 'a'] = 1;
  }
  for (int i = 0; i < m; ++i) {
    string q;
    cin >> q;
    bool was = 0;
    for (int j = 0; j < n; ++j) {
      if (t[j] != '*' && t[j] != q[j]) {
        was = 1;
        break;
      }
      if (t[j] == '*' && bad[q[j] - 'a']) {
        was = 1;
        break;
      }
    }
    if (!was) {
      second.push_back(q);
    }
  }
  m = second.size();
  for (char ch = 'a'; ch <= 'z'; ++ch) {
    if (!bad[ch - 'a']) {
      int cur = 0;
      for (int i = 0; i < m; ++i) {
        for (int j = 0; j < n; ++j) {
          if (second[i][j] == ch) {
            cur++;
            break;
          }
        }
      }
      if (cur == m && m != 0) {
        ans++;
      }
    }
  }
  cout << ans << endl;
}
