#include <bits/stdc++.h>
using namespace std;
int n;
bool operation[10] = {0};
int f[25] = {0};
int store[25];
int num = 0;
int minans = 10;
bool check() {
  for (int i = 0; i < num; i++)
    for (int j = i + 1; j < num; j++) {
      if (f[i] == f[j]) return false;
    }
  return true;
}
void dfs(int k) {
  if (check() && minans > k) {
    minans = k;
    return;
  }
  if (k >= minans) return;
  for (int i = 0; i < 10; i++) {
    if (operation[i]) {
      for (int j = 0; j < num; j++) {
        if ((i >= 5) && (store[j] % 5 == i - 5)) f[j] += 1 << k;
        if ((i < 5) && (store[j] / 5 == i)) f[j] += 1 << k;
      }
      operation[i] = false;
      dfs(k + 1);
      operation[i] = true;
      for (int j = 0; j < num; j++) {
        if ((i >= 5) && (store[j] % 5 == i - 5)) f[j] -= 1 << k;
        if ((i < 5) && (store[j] / 5 == i)) f[j] -= 1 << k;
      }
    }
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    string temps;
    int temp;
    cin >> temps;
    if (temps[0] == 'R') {
      temp = 0;
      operation[0] = true;
    }
    if (temps[0] == 'G') {
      temp = 5;
      operation[1] = true;
    }
    if (temps[0] == 'B') {
      temp = 10;
      operation[2] = true;
    }
    if (temps[0] == 'Y') {
      temp = 15;
      operation[3] = true;
    }
    if (temps[0] == 'W') {
      temp = 20;
      operation[4] = true;
    }
    temp += int(temps[1] - '1');
    operation[int(temps[1] - '0') + 4] = true;
    if (!f[temp]) {
      f[temp] = 1;
      store[num] = temp;
      num++;
    }
  }
  memset(f, 0, sizeof(f));
  dfs(0);
  printf("%d\n", minans);
  return 0;
}
