#include <bits/stdc++.h>
using namespace std;
void set(int& n, int first) { n = n | (1 << first); }
void reset(int& n, int first) { n = n & ~(1 << first); }
bool chk(int n, int first) { return (bool)(n & (1 << first)); }
const int mx = 1024;
pair<int, int> a[101];
bool b[101];
int n;
bool is_ok(int mask) {
  int i, j, k;
  for (i = 0; i < n; i++) {
    for (j = i + 1; j < n; j++) {
      if (a[i] == a[j]) continue;
      if (a[i].first != a[j].first && chk(mask, a[i].first)) continue;
      if (a[i].first != a[j].first && chk(mask, a[j].first)) continue;
      if (a[i].second != a[j].second && chk(mask, a[j].second)) continue;
      if (a[i].second != a[j].second && chk(mask, a[i].second)) continue;
      return false;
    }
  }
  return true;
}
int main() {
  int i, j, k;
  map<char, int> mm;
  char s[10];
  while (scanf("%d", &n) == 1) {
    for (i = 0; i < n; i++) {
      scanf("%s", s);
      k = s[1] - '0' + 4;
      if (s[0] == 'R')
        j = 1;
      else if (s[0] == 'G')
        j = 2;
      else if (s[0] == 'B')
        j = 3;
      else if (s[0] == 'Y')
        j = 4;
      else
        j = 5;
      a[i] = make_pair(j - 1, k);
    }
    sort(a, a + n);
    n = int(unique(a, a + n) - a);
    int ans = 1000000;
    for (i = 0; i < mx; i++) {
      int cnt = 0;
      for (j = 0; j < 10; j++) {
        if (chk(i, j)) cnt++;
      }
      if (is_ok(i)) ans = min(ans, cnt);
    }
    printf("%d\n", ans);
  }
}
