#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pll = pair<ll, ll>;
using vll = vector<ll>;
using vpll = vector<pll>;
struct d_ {
  template <typename T>
  d_& operator,(const T& x) {
    cerr << ' ' << x;
    return *this;
  }
  template <typename T>
  d_& operator,(const vector<T>& x) {
    for (auto x : x) cerr << ' ' << x;
    return *this;
  }
} d_t;
int main(void) {
  ios_base::sync_with_stdio(false);
  ll n;
  cin >> n;
  string w;
  cin >> w;
  set<char> abc;
  for (auto i : w)
    if (i != '*') abc.insert(i);
  ll m;
  cin >> m;
  vector<string> dict(m);
  for (ll i(0); i < m; i++) cin >> dict[i];
  ll ret = 0;
  for (ll i(0); i < 26; i++) {
    if (abc.count('a' + i)) continue;
    bool ok = 1;
    for (ll j(0); j < m; j++) {
      bool skip = 0;
      for (ll k(0); k < n; k++)
        if ((w[k] == '*' && abc.count(dict[j][k])) ||
            (w[k] != '*' && w[k] != dict[j][k]))
          skip = 1;
      if (skip) continue;
      bool cok = 0;
      for (ll k(0); k < n; k++) cok |= w[k] == '*' && dict[j][k] - 'a' == i;
      ok &= cok;
    }
    ret += ok;
  }
  cout << ret << endl;
  return 0;
}
