#include <bits/stdc++.h>
const int N = 100007;
using namespace std;
char p[500001], s1[500001];
int a[105] = {0}, b[105] = {0};
set<char> st;
set<char> st1;
string s;
vector<char> odd;
vector<char> even;
map<char, int> mp;
map<char, int>::iterator it;
int main() {
  int n, m, i, j, k, t, sum, num = 0, sig = 1;
  cin >> n;
  cin >> s, s1;
  for (i = 0; i < n; i++) {
    if (s[i] == '*') {
      num++;
      a[i] = 1;
    }
    if (a[i] == 0) st.insert(s[i]);
  }
  cin >> m;
  t = m;
  while (m--) {
    sig = 1;
    cin >> s1;
    for (i = 0; i < n; i++) {
      if (a[i] == 0) {
        if (s1[i] != s[i]) {
          sig = 0;
          break;
        }
      } else {
        int temp = st.size();
        st.insert(s1[i]);
        if (temp != st.size()) {
          st.erase(s1[i]);
          continue;
        } else {
          sig = 0;
          break;
        }
      }
    }
    if (sig) {
      for (i = 0; i < n; i++) {
        if (a[i]) {
          int temp1 = st1.size();
          st1.insert(s1[i]);
          if (temp1 != st1.size()) mp[s1[i]]++;
        }
      }
    } else {
      t--;
    }
    st1.clear();
  }
  sum = 0;
  if (t) {
    for (it = mp.begin(); it != mp.end(); it++) {
      if (t == it->second) sum++;
    }
  }
  cout << sum << endl;
  return 0;
}
