#include <bits/stdc++.h>
using namespace std;
int mod_v(int num) { return (num % 1000000007 + 1000000007) % 1000000007; }
void memset1(vector<int>& v, int s, int value) {
  for (int i = 0; i < s; i++) v[i] = value;
}
void memset2(vector<vector<int> >& v, int s1, int s2, int value) {
  for (int i = 0; i < s1; i++)
    for (int j = 0; j < s2; j++) v[i][j] = value;
}
int fast_pow(int n, int p) {
  if (p == 1) return n;
  if (p % 2) {
    int g = mod_v(mod_v(n) * mod_v(fast_pow(n, p - 1)));
    return g;
  } else {
    int g = fast_pow(n, p / 2);
    g = mod_v(mod_v(g) * mod_v(g));
    return g;
  }
}
int modInverse(int n) { return fast_pow(n, 1000000007 - 2); }
int get(char x) {
  if (x == 'R') return 1;
  if (x == 'G') return 2;
  if (x == 'B') return 3;
  if (x == 'Y') return 4;
  if (x == 'W') return 5;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<string> keep(n);
  for (int i = 0; i < n; i++) cin >> keep[i];
  int ans = 1 << 30;
  for (int i = 0; i < (1 << 10); i++) {
    int count = 0;
    for (int j = 0; j < 10; j++)
      if ((i & (1 << j)) == (1 << j) ? true : false) count++;
    vector<int> store(n, 0);
    for (int j = 0; j < 5; j++) {
      if ((i & (1 << j)) == (1 << j) ? true : false) {
        for (int k = 0; k < n; k++) {
          if (j + 1 == get((char)keep[k][0])) store[k] += (1 << j);
        }
      }
    }
    for (int j = 5; j < 10; j++) {
      if ((i & (1 << j)) == (1 << j) ? true : false) {
        for (int k = 0; k < n; k++) {
          if (j - 5 + '1' == keep[k][1]) store[k] += (1 << j);
        }
      }
    }
    bool found = true;
    for (int j = 0; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        if (store[j] == store[k] && keep[j] != keep[k]) found = false;
      }
    }
    if (found) ans = min(ans, count);
  }
  printf("%d\n", ans);
  return 0;
}
