#include <bits/stdc++.h>
using namespace std;
int id[1111], a[30], b[30], num, ans;
char s[5];
int Count(int x) {
  int cnt = 0;
  while (x) {
    cnt += x & 1;
    x /= 2;
  }
  return cnt;
}
int check(int x) {
  int flag[1025];
  memset(flag, 0, sizeof(flag));
  for (int i = 0; i < num; i++) {
    b[i] = a[i] & x;
    if (flag[b[i]]) return 0;
    flag[b[i]] = 1;
  }
  return 1;
}
int main() {
  int i, j, k, n;
  map<char, int> mp;
  mp['1'] = 0, mp['2'] = 1, mp['3'] = 2, mp['4'] = 3, mp['5'] = 4;
  mp['R'] = 5, mp['G'] = 6, mp['B'] = 7, mp['Y'] = 8, mp['W'] = 9;
  while (scanf("%d", &n) != EOF) {
    memset(id, 0, sizeof(id));
    for (i = 0; i < n; i++) {
      scanf("%s", s);
      k = (1 << mp[s[0]]) + (1 << mp[s[1]]);
      id[k] = 1;
    }
    num = 0, ans = 100;
    for (i = 0; i < 1111; i++)
      if (id[i]) a[num++] = i;
    for (i = 0; i < 1024; i++) {
      if (Count(i) >= ans) continue;
      if (check(i)) ans = Count(i);
    }
    printf("%d\n", ans);
  }
  return 0;
}
