#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 9;
const double eps = 1e-9;
const int inf = 1e9;
const double PI = 3.1415926535897932384626433832795;
const int N = 100005;
set<char> st;
int mas[26];
bool mas2[26];
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  string s;
  cin >> s;
  for (auto x : s) {
    if (x != '*') st.insert(x);
  }
  int m;
  cin >> m;
  int k = 0;
  for (int i = 0; i < m; i++) {
    memset(mas2, 0, sizeof(mas2));
    string s2;
    cin >> s2;
    bool good = true;
    for (int j = 0; j < n; j++) {
      if (s[j] == '*') {
        if (st.count(s2[j])) {
          good = false;
          break;
        }
      } else {
        if (s[j] != s2[j]) {
          good = false;
          break;
        }
      }
    }
    if (good) {
      k++;
      for (int j = 0; j < s2.size(); j++) {
        if (s[j] == '*') mas2[s2[j] - 'a'] = true;
      }
      for (int j = 0; j < 26; j++) {
        mas[j] += mas2[j];
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (mas[i] == k) ans++;
  }
  cout << ans;
  return 0;
}
