#include <bits/stdc++.h>
const int inf = 0xfffffff;
const long long INF = 1ll << 61;
using namespace std;
vector<int> G[100 + 55];
int n;
char s[100 + 55][2];
int asd[100];
int num[100 + 55];
void init() {
  memset(num, 0, sizeof(num));
  for (int i = 1; i < 11; i++) G[i].clear();
  asd['R'] = 5;
  asd['G'] = 6;
  asd['B'] = 7;
  asd['Y'] = 8;
  asd['W'] = 9;
}
bool input() {
  while (scanf("%d", &n) == 1) {
    for (int i = 0; i < n; i++) {
      scanf("%s", s[i]);
      G[asd[s[i][0]]].push_back(s[i][1] - '1');
      G[s[i][1] - '1'].push_back(asd[s[i][0]]);
    }
    return false;
  }
  return true;
}
void cal(int &ans) {
  ans = 10;
  for (int k = 0; k < (1 << 10); k++) {
    int now = 0;
    for (int i = 0; i < 10; i++)
      if (k & (1 << i)) now++;
    if (now >= ans) continue;
    int mark1 = 0, mark2 = 0;
    memset(num, 0, sizeof(num));
    for (int i = 5; i < 10; i++) {
      for (int j = 0; j < 5; j++) {
        for (int l = 0; l < G[j].size(); l++) {
          if (G[j][l] == i) {
            if ((k & (1 << i)) && (k & (1 << j))) goto loop;
            if ((k & (1 << i)) || (k & (1 << j))) {
              if ((k & (1 << i))) {
                if (!num[i]) {
                  num[i]++;
                  goto loop;
                }
              }
              if ((k & (1 << j))) {
                if (!num[j]) {
                  num[j]++;
                  goto loop;
                }
              }
            } else {
              if (!mark2) {
                mark2++;
                goto loop;
              }
            }
            mark1++;
            break;
          }
        }
      loop:;
      }
    }
    if (!mark1) ans = min(ans, now);
  }
}
void output(int &ans) { printf("%d\n", ans); }
int main() {
  while (true) {
    init();
    if (input()) return 0;
    int ans;
    cal(ans);
    output(ans);
  }
}
