#include <bits/stdc++.h>
using namespace std;
int n, cl[111], vl[111], x[111], ans = 10;
char card[5];
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", card);
    switch (card[0]) {
      case 'R':
        cl[i] = 0;
        break;
      case 'G':
        cl[i] = 1;
        break;
      case 'B':
        cl[i] = 2;
        break;
      case 'Y':
        cl[i] = 3;
        break;
      case 'W':
        cl[i] = 4;
    }
    vl[i] = card[1] - '1' + 5;
  }
  for (int i = 0; i < (1 << 10); ++i) {
    bool flag = 0;
    for (int j = 1; j <= n; ++j) {
      x[j] = 0;
      if ((i >> cl[j]) & 1) x[j] |= 1 << cl[j];
      if ((i >> vl[j]) & 1) x[j] |= 1 << vl[j];
      for (int k = 1; k < j; ++k)
        if (x[j] == x[k] && (cl[j] != cl[k] || vl[j] != vl[k])) {
          flag = 1;
          break;
        }
      if (flag) break;
    }
    if (!flag) ans = min(ans, __builtin_popcount(i));
  }
  printf("%d\n", ans);
  return 0;
}
