#include <bits/stdc++.h>
using namespace std;
int N, i, j, k, l, MIN = 10, sum, t, mask;
string str = "RGBYW", s;
int score[5][5], sel[5][5];
bool worse;
int where(int X) {
  if (!X) return 0;
  if (!(X & 1)) return where(X >> 1);
  return where(X >> 1) + 1;
}
int main() {
  cin >> N;
  for (i = 0; i < N; ++i) {
    cin >> s;
    j = 0;
    while (str[j] != s[0]) ++j;
    sel[j][(s[1] - '0') - 1] = 1;
  }
  for (mask = 0; mask < (1 << 10); mask++) {
    worse = 0;
    for (i = 0; i <= 4; ++i)
      for (j = 0; j <= 4; ++j)
        for (k = 0; k <= 4; ++k)
          for (l = 0; l <= 4; ++l) {
            if ((i == k && j == l) || (!sel[i][j] || !sel[k][l])) continue;
            sum = t = 0;
            if (mask & (1 << i)) sum += (1 << i);
            if (mask & (1 << (j + 5))) sum += (1 << (j + 5));
            if (mask & (1 << k)) t += (1 << k);
            if (mask & (1 << (l + 5))) t += (1 << (l + 5));
            if (sum == t) worse = 1;
          }
    if (!worse) MIN = min(MIN, where(mask));
  }
  cout << MIN;
  return 0;
}
