#include <bits/stdc++.h>
using namespace std;
void fre() {
  freopen("c://test//input.in", "r", stdin);
  freopen("c://test//output.out", "w", stdout);
}
template <class T1, class T2>
inline void gmax(T1 &a, T2 b) {
  if (b > a) a = b;
}
template <class T1, class T2>
inline void gmin(T1 &a, T2 b) {
  if (b < a) a = b;
}
const int N = 0, M = 0, Z = 1e9 + 7, ms63 = 0x3f3f3f3f;
char s[105][3];
int o[128];
int n;
bool check(int i) {
  for (int j = 1; j <= n; ++j) {
    for (int k = j + 1; k <= n; ++k) {
      if (s[j][0] != s[k][0] &&
              ((i >> o[s[j][0]] & 1) || (i >> o[s[k][0]] & 1)) ||
          s[j][1] != s[k][1] &&
              ((i >> o[s[j][1]] & 1) || (i >> o[s[k][1]] & 1)))
        ;
      else if (strcmp(s[j], s[k]))
        return 0;
    }
  }
  return 1;
}
int main() {
  o['R'] = 0;
  o['G'] = 1;
  o['B'] = 2;
  o['Y'] = 3;
  o['W'] = 4;
  o['1'] = 5;
  o['2'] = 6;
  o['3'] = 7;
  o['4'] = 8;
  o['5'] = 9;
  while (~scanf("%d", &n)) {
    for (int i = 1; i <= n; ++i) scanf("%s", s[i]);
    int top = 1 << 10;
    int ans = 1e9;
    for (int i = 0; i < top; ++i) {
      if (check(i)) {
        int num = 0;
        for (int j = i; j; j >>= 1) num += j & 1;
        gmin(ans, num);
      }
    }
    printf("%d\n", ans);
  }
  return 0;
}
