#include <bits/stdc++.h>
using namespace std;
set<string> s;
vector<string> v;
string c = "RGBYW12345";
int diff(int i, int j, int k) {
  if (v[i][0] != v[j][0] && (v[i][0] == c[k] || v[j][0] == c[k])) {
    return 1;
  }
  if (v[i][1] != v[j][1] && (v[i][1] == c[k] || v[j][1] == c[k])) {
    return 1;
  }
  return 0;
}
int main(void) {
  int n;
  char a[5];
  scanf(" %d", &n);
  for (int i = 0; i < n; i++) {
    scanf(" %s", a);
    s.insert(string(a));
  }
  for (set<string>::iterator it = s.begin(); it != s.end(); it++) {
    v.push_back(*it);
  }
  int res = 10;
  for (int mask = 0; mask < 1 << 10; mask++) {
    int aux = __builtin_popcount(mask);
    int good = 1;
    for (int i = 0; i < (int)v.size(); i++) {
      for (int j = i + 1; j < (int)v.size(); j++) {
        int ok = 0;
        for (int k = 0; k < 10; k++) {
          int bit = (mask >> k) & 1;
          if (bit && diff(i, j, k)) {
            ok = 1;
            break;
          }
        }
        good = good & ok;
      }
    }
    if (good) {
      res = min(res, aux);
    }
  }
  printf("%d\n", res);
  return 0;
}
