#include <bits/stdc++.h>
using namespace std;
int n;
char s[101];
int b[101];
int a[101];
inline int get() {
  int r = 0;
  if (s[0] == 'R') r |= 1 << 0;
  if (s[0] == 'G') r |= 1 << 1;
  if (s[0] == 'B') r |= 1 << 2;
  if (s[0] == 'Y') r |= 1 << 3;
  if (s[0] == 'W') r |= 1 << 4;
  r |= 1 << (5 + s[1] - '1');
  return r;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s);
    a[i] = get();
  }
  int ans = 10;
  for (int mask = 0; mask < (1 << 10); ++mask) {
    for (int i = 0; i < n; ++i) b[i] = 0;
    for (int i = 0; i < 10; ++i)
      if ((mask >> i) & 1) {
        for (int j = 0; j < n; ++j)
          if ((a[j] >> i) & 1) b[j] |= (1 << i);
      }
    bool ok = 1;
    for (int i = 0; i < n && ok; ++i)
      for (int j = i + 1; j < n && ok; ++j)
        if (b[i] == b[j] && a[i] != a[j]) ok = 0;
    if (ok) ans = min(ans, __builtin_popcount(mask));
  }
  printf("%d\n", ans);
  return 0;
}
