#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int INF = 1E9;
const int MAXN = 111;
int n, ans, cur;
string t = "RGBYW";
string s[MAXN];
int have[5][5], used[2][5];
int main() {
  memset(have, 0, sizeof(have));
  cin >> n;
  for (int i = 0; i < (int)(n); i++) {
    cin >> s[i];
    int k1 = 0;
    for (int j = 0; j < (int)(t.size()); j++)
      if (t[j] == s[i][0]) k1 = j;
    int k2 = s[i][1] - '1';
    have[k1][k2] = 1;
  }
  ans = 10;
  for (int mask = 0; mask < (1 << 10); mask++) {
    cur = 0;
    memset(used, 0, sizeof(used));
    for (int i = 0; i < (int)(5); i++) {
      int k = (mask >> i) & 1;
      cur += k;
      used[0][i] = k;
    }
    for (int i = 0; i < (int)(5); i++) {
      int k = (mask >> (i + 5)) & 1;
      cur += k;
      used[1][i] = k;
    }
    bool good = 1;
    for (int i = 0; i < (int)(5); i++)
      for (int j = 0; j < (int)(5); j++)
        if (have[i][j]) {
          for (int k = 0; k < (int)(5); k++)
            if (i != k && have[k][j]) {
              if (!(used[0][i] || used[0][k])) good = 0;
            }
          for (int k = 0; k < (int)(5); k++)
            if (j != k && have[i][k]) {
              if (!(used[1][j] || used[1][k])) good = 0;
            }
          for (int i1 = 0; i1 < (int)(5); i1++)
            for (int j1 = 0; j1 < (int)(5); j1++)
              if (i1 != i && j1 != j && have[i1][j1])
                if (!(used[0][i] || used[0][i1] || used[1][j] || used[1][j1]))
                  good = 0;
        }
    if (good) ans = min(ans, cur);
  }
  cout << ans;
  return 0;
}
