#include <bits/stdc++.h>
using namespace std;
const int N = 123, BITS = 11, MAX = 7;
int c[N], num[N];
int a[MAX][MAX];
char s[N];
int bit(int x) {
  int res = 0;
  while (x != 0) {
    res += x % 2;
    x /= 2;
  }
  return res;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%s", s);
    if (s[0] == 'R') c[i] = 0;
    if (s[0] == 'G') c[i] = 1;
    if (s[0] == 'B') c[i] = 2;
    if (s[0] == 'Y') c[i] = 3;
    if (s[0] == 'W') c[i] = 4;
    num[i] = s[1] - '1';
  }
  int m = 0;
  for (int i = 0; i < n; ++i) {
    if (a[c[i]][num[i]] == 0) {
      ++m;
      a[c[i]][num[i]] = 1;
    }
  }
  int ans = 10;
  for (int cnt = 0; cnt < (1 << BITS); ++cnt) {
    int count = 0;
    for (int i = 0; i < 5; ++i) {
      for (int j = 0; j < 5; ++j) {
        for (int k = 0; k < 5; ++k) {
          for (int l = 0; l < 5; ++l) {
            if (a[i][j] == 1 && a[k][l] == 1) {
              int tmp = 0;
              if (i != k)
                tmp = ((1 << (i + 5)) & cnt) || ((1 << (k + 5)) & cnt);
              int tmp2 = 0;
              if (j != l) tmp2 = ((1 << j) & cnt) || ((1 << l) & cnt);
              if (tmp || tmp2) ++count;
            }
          }
        }
      }
    }
    if (count == m * (m - 1)) {
      int temp = bit(cnt);
      if (ans > temp) ans = temp;
    }
  }
  printf("%d\n", ans);
  return 0;
}
