#include <bits/stdc++.h>
using namespace std;
template <class T>
inline int sz(const T& container) {
  return static_cast<int>(container.size());
}
void solve();
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
namespace input {
inline int nint() {
  int res = 0;
  char c = getchar();
  while ((c < '0' || c > '9')) c = getchar();
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
inline long long nlong() {
  long long res = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') res = res * 10 + c - '0', c = getchar();
  return res;
}
inline bool isSpace(const char& c) {
  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}
inline void next(char* str) {
  char c = getchar();
  while (isSpace(c)) c = getchar();
  size_t head = 0;
  while (!isSpace(c)) str[head++] = c, c = getchar();
  str[head] = 0;
}
inline char nchar() {
  char c = getchar();
  while (isSpace(c)) c = getchar();
  return c;
}
}  // namespace input
using namespace input;
const int N = 1e3 + 5;
char s[N];
char t[N];
void solve() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  vector<int> cl;
  set<char> w;
  for (int i = 0; i < (n); i++) {
    if (s[i] == '*') {
      cl.push_back(i);
    } else {
      w.insert(s[i]);
    }
  }
  vector<string> g;
  int m;
  scanf("%d", &m);
  for (int _ = 0; _ < (m); _++) {
    scanf("%s", t);
    bool good = true;
    for (int i = 0; i < (n); i++) {
      if (s[i] != '*' && s[i] != t[i]) {
        good = false;
      }
      if (s[i] == '*' && w.count(t[i]) != 0) {
        good = false;
      }
    }
    if (good) {
      g.push_back(string(t));
    }
  }
  int ans = 0;
  for (char c = 'a'; c <= 'z'; c++) {
    if (w.count(c)) continue;
    bool was = false;
    for (int i = 0; i < sz(cl); i++) {
      int cnt = 0;
      for (int j = 0; j < sz(g); j++) {
        if (g[j][cl[i]] == c) {
          cnt++;
        }
      }
      if (cnt == sz(g)) {
        was = true;
      }
    }
    int cnt = 0;
    for (int i = 0; i < sz(g); i++) {
      string str = "";
      str += c;
      if (g[i].find(str) != string::npos) {
        cnt++;
      }
    }
    if (cnt == sz(g)) {
      was = true;
    }
    if (was) {
      ans++;
    }
  }
  cout << ans << '\n';
}
