#include <bits/stdc++.h>
using namespace std;
int a[111], b[111];
int n;
int num(int s) { return (s == 0 ? 0 : (num(s >> 1) + (s & 1))); }
int to(char ch) {
  if (ch == 'R')
    return 0;
  else if (ch == 'G')
    return 1;
  else if (ch == 'B')
    return 2;
  else if (ch == 'Y')
    return 3;
  else if (ch == 'W')
    return 4;
  else
    return -1;
}
bool ok(int s) {
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (a[i] == a[j]) {
        if (b[i] != b[j] && !(s & (1 << b[i])) && !(s & (1 << b[j])))
          return false;
      } else {
        if ((s & (1 << a[i])) || (s & (1 << a[j])))
          continue;
        else if (b[i] == b[j])
          return false;
        else if (!(s & (1 << b[i])) && !(s & (1 << b[j])))
          return false;
      }
    }
  }
  return true;
}
int main() {
  char str[5];
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; ++i) {
      scanf("%s", str);
      a[i] = to(str[0]);
      b[i] = str[1] - '1' + 5;
    }
    int ans = 10;
    for (int i = 0; i < 1024; ++i) {
      int tmp = num(i);
      if (tmp < ans && ok(i)) ans = tmp;
    }
    printf("%d\n", ans);
  }
  return 0;
}
