#include <bits/stdc++.h>
using namespace std;
int val[11][11];
char a[5] = {'R', 'G', 'B', 'Y', 'W'};
int bit(int x) {
  int cnt = 0;
  while (x) {
    if (x & 1) cnt++;
    x >>= 1;
  }
  return cnt;
}
int min(int x, int y) { return x < y ? x : y; }
bool solve(int x) {
  int unknown = 0, cnt[11] = {0};
  for (int i = 1; i <= 5; i++) {
    for (int j = 6; j <= 10; j++) {
      if (val[i][j]) {
        if (x & (1 << (i - 1)) && !(x & (1 << (j - 1)))) cnt[i]++;
        if (!(x & (1 << (i - 1))) && (x & (1 << (j - 1)))) cnt[j]++;
        if (!(x & (1 << (i - 1))) && !(x & (1 << (j - 1)))) unknown++;
      }
    }
  }
  if (unknown > 1) return false;
  for (int i = 1; i < 11; i++)
    if (cnt[i] > 1) return false;
  return true;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char ch, num;
    getchar();
    scanf("%c%c", &ch, &num);
    int idx_c, idx_n;
    for (int i = 0; i < 5; i++)
      if (ch == a[i]) {
        idx_c = i + 1;
        break;
      }
    idx_n = num - '0' + 5;
    val[idx_c][idx_n] = 1;
  }
  int ans = 10;
  for (int i = 0; i < (1 << 11); i++) {
    if (solve(i)) ans = min(ans, bit(i));
  }
  printf("%d\n", ans);
  return 0;
}
