#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const char cs[10] = {'R', 'G', 'W', 'B', 'Y', '1', '2', '3', '4', '5'};
int n;
map<char, int> op;
vector<int> oo;
int res = 100;
void work(vector<string> &s, int q, int r = 0) {
  if (r > res) return;
  if (q == 10) {
    oo.assign(n, 0);
    for (long long i = 0; i < n; i++) {
      for (long long j = 0; j < 2; j++) {
        if (op[s[i][j]] == 1) {
          oo[i]++;
        }
      }
    }
    bool can1, can2;
    for (long long i = 0; i < n; i++) {
      if (oo[i] == 2) continue;
      if (oo[i] == 0) {
        for (long long j = 0; j < n; j++)
          if (oo[j] == 0 && i != j && s[i] != s[j]) return;
      }
      can1 = false;
      can2 = false;
      if (oo[i] == 1) {
        if (op[s[i][0]] == 1) {
          can1 = true;
          for (long long j = 0; j < n; j++) {
            if (i != j && s[i][0] == s[j][0] && s[i][1] != s[j][1] &&
                oo[j] != 2) {
              can1 = false;
            }
          }
        }
        if (op[s[i][1]] == 1) {
          can2 = true;
          for (long long j = 0; j < n; j++) {
            if (i != j && s[i][1] == s[j][1] && s[i][0] != s[j][0] &&
                oo[j] != 2) {
              can2 = false;
            }
          }
        }
        if (!can1 && !can2) return;
      }
    }
    res = min(res, r);
    return;
  }
  op[cs[q]] = 0;
  work(s, q + 1, r);
  op[cs[q]] = 1;
  work(s, q + 1, r + 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  vector<string> a(n);
  oo.resize(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  work(a, 0, 0);
  cout << res;
}
