#include <bits/stdc++.h>
using namespace std;
int a[200], b[200], n, ans;
int change(char x) {
  if (x == 'R')
    return 0;
  else if (x == 'G')
    return 1;
  else if (x == 'B')
    return 2;
  else if (x == 'Y')
    return 3;
  else if (x == 'W')
    return 4;
}
int calc(int k) {
  int sum = 0;
  while (k > 0) {
    sum += (k & 1);
    k = k >> 1;
  }
  return sum;
}
bool check(int x) {
  for (int i = 1; i < n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (a[i] == a[j] && b[i] == b[j]) {
        continue;
      }
      if (a[i] == a[j] && (x & (1 << (b[i] + 5)) || x & (1 << (b[j] + 5)))) {
        continue;
      }
      if (b[i] == b[j] && (x & (1 << (a[i])) || x & (1 << (a[j])))) {
        continue;
      }
      if (a[i] != a[j] && b[i] != b[j]) {
        if ((x & (1 << a[i])) || (x & (1 << (b[i] + 5))) || (x & (1 << a[j])) ||
            (x & (1 << (b[j] + 5)))) {
          continue;
        }
      }
      return false;
    }
  return true;
}
void solve() {
  for (int k = 0; k < (1 << 10); k++)
    if (check(k)) {
      ans = min(ans, calc(k));
    }
  printf("%d\n", ans);
}
int main() {
  char s[20];
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", &s);
    a[i] = change(s[0]);
    b[i] = s[1] - '1';
  }
  ans = 20;
  solve();
}
