#include <bits/stdc++.h>
using namespace std;
int get(char a) {
  switch (a) {
    case 'R':
      return 0;
    case 'G':
      return 1;
    case 'B':
      return 2;
    case 'Y':
      return 3;
    case 'W':
      return 4;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  int a[101];
  for (int i = 0; i < n; ++i) {
    char s[5];
    scanf("%s", s);
    a[i] = (1 << (get(s[0]) + 5)) + (1 << (s[1] - '1'));
  }
  int ans = 9;
  for (int i = 0; i < (1 << 10); ++i) {
    int ok = 1;
    for (int j = 0; j < n; ++j) {
      for (int k = j + 1; k < n; ++k) {
        if (a[j] == a[k]) continue;
        if (!(i & (a[j] ^ a[k]))) {
          ok = 0;
          break;
        }
      }
      if (ok == 0) break;
    }
    if (ok) {
      int g = 0;
      for (int j = 0; j < 10; ++j) {
        if ((1 << j) & i) g++;
      }
      if (g < ans) ans = g;
    }
  }
  printf("%d\n", ans);
  return 0;
}
