#include <bits/stdc++.h>
using namespace std;
char s[1005][100];
bool val[1005];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s[0]);
  int m;
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%s", s[i]);
  for (int i = 1; i <= m; i++) val[i] = true;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < n; j++) {
      if (s[0][j] != '*' && s[i][j] != s[0][j]) {
        val[i] = false;
        break;
      }
    }
  }
  bool yj[26] = {};
  for (int i = 0; i < n; i++)
    if (s[0][i] != '*') yj[s[0][i] - 'a'] = true;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < n; j++) {
      if (s[0][j] == '*' && yj[s[i][j] - 'a']) {
        val[i] = false;
        break;
      }
    }
  }
  int all = 0;
  for (int i = 1; i <= m; i++)
    if (val[i]) all++;
  int cnt = 0;
  for (char c = 'a'; c <= 'z'; c++) {
    bool y = false;
    for (int j = 0; j < n; j++)
      if (s[0][j] == c) y = true;
    if (y) continue;
    int ky = 0;
    for (int i = 1; i <= m; i++) {
      if (!val[i]) continue;
      for (int j = 0; j < n; j++) {
        if (s[0][j] == '*' && s[i][j] == c) {
          ky++;
          break;
        }
      }
    }
    if (ky == all) cnt++;
  }
  printf("%d", cnt);
  return 0;
}
