#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  char a[n], b[n];
  for (int i = 0; i < n; i++) {
    char c;
    cin >> c;
    a[i] = c;
    cin >> c;
    b[i] = c;
  }
  int o = 20;
  string g = "RGBYW12345";
  for (int i = 0; i < 1024; i++) {
    string d = "";
    int k = 0;
    for (int j = 0; j < 10; j++) {
      if ((i & (1 << j)) > 0) {
        d += g[j];
        k++;
      }
    }
    int f = 0;
    for (int x = 0; x < n; x++) {
      for (int y = 0; y < n; y++) {
        if (x != y) {
          int l = d.find(a[x]), m = d.find(a[y]), l1 = d.find(b[x]),
              m1 = d.find(b[y]);
          if (l < 0 || l >= d.size()) l = -1;
          if (m < 0 || m >= d.size()) m = -1;
          if (l1 < 0 || l1 >= d.size()) l1 = -1;
          if (m1 < 0 || m1 >= d.size()) m1 = -1;
          if (a[x] != a[y] && b[x] != b[y]) {
            if (l == -1 && m == -1 && l1 == -1 && m1 == -1) {
              f = 1;
              break;
            }
          } else if (a[x] == a[y] && b[x] != b[y]) {
            if (l1 == -1 && m1 == -1) {
              f = 1;
              break;
            }
          } else if (a[x] != a[y] && b[x] == b[y]) {
            if (l == -1 && m == -1) {
              f = 1;
              break;
            }
          }
        }
      }
      if (f == 1) break;
    }
    if (f == 0) o = min(o, k);
  }
  cout << o;
}
