#include <bits/stdc++.h>
using namespace std;
char str[1000 + 100][110], a[100];
bool vis[110];
bool dp[1100][26];
int main() {
  int n;
  scanf("%d%s", &n, a);
  for (int i = 0; i < n; i++) {
    if (a[i] != '*') vis[a[i] - 'a'] = 1;
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%s", str[i]);
    for (int j = 0; j < n; j++) {
      if (vis[str[i][j] - 'a']) {
        if (a[j] != str[i][j]) {
          memset(dp[i], 1, sizeof(dp[i]));
          break;
        }
      } else if (a[j] != '*') {
        memset(dp[i], 1, sizeof(dp[i]));
        break;
      } else
        dp[i][str[i][j] - 'a'] = 1;
    }
  }
  int ans = 0;
  for (int i = 0; i < 26; i++) {
    if (!vis[i]) {
      bool su = 1;
      for (int j = 0; j < m; j++) su &= dp[j][i];
      if (su) ans++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
