#include <bits/stdc++.h>
using namespace std;
int m = 0, mask[11], cnt[6][6], N;
vector<pair<int, int> > cards;
int next_mask() {
  m++;
  for (int i = int(0); i <= int(9); i++) mask[i + 1] = (m >> i) & 1;
  return m != (1 << 10);
}
int okay() {
  pair<int, int> a[N];
  for (int i = int(0); i <= int(N - 1); i++) {
    a[i] = pair<int, int>(0, 0);
    if (mask[cards[i].first]) {
      a[i].first = cards[i].first;
    }
    if (mask[5 + cards[i].second]) {
      a[i].second = cards[i].second;
    }
  }
  for (int i = int(0); i <= int(N - 1); i++)
    for (int j = int(0); j <= int(N - 1); j++)
      if (i != j)
        if (a[i] == a[j]) {
          return 0;
        }
  return 1;
}
int main() {
  int number;
  cin >> number;
  char c;
  int x;
  for (int i = int(1); i <= int(number); i++) {
    cin >> c >> x;
    if (c == 'R') cnt[1][x] = 1;
    if (c == 'G') cnt[2][x] = 1;
    if (c == 'B') cnt[3][x] = 1;
    if (c == 'Y') cnt[4][x] = 1;
    if (c == 'W') cnt[5][x] = 1;
  }
  for (int i = int(1); i <= int(5); i++)
    for (int j = int(1); j <= int(5); j++)
      if (cnt[i][j]) cards.push_back(pair<int, int>(i, j));
  N = cards.size();
  int ans = 2000000000;
  m = 0;
  do {
    if (okay()) {
      int x = 0;
      for (int i = int(1); i <= int(10); i++)
        if (mask[i]) x++;
      ans = min(ans, x);
    }
  } while (next_mask());
  cout << ans << endl;
  cards.clear();
  for (int i = int(0); i <= int(5); i++)
    for (int j = int(0); j <= int(5); j++) cnt[i][j] = 0;
  return 0;
}
