#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
const long double pi = acos(-1);
const long long int mod = 1e9 + 7;
bool debug = false;
long long int hashval(char ch) {
  if (ch == 'R') return 0;
  if (ch == 'G') return 1;
  if (ch == 'B') return 2;
  if (ch == 'Y') return 3;
  if (ch == 'W') return 4;
  if (ch == '1') return 5;
  if (ch == '2') return 6;
  if (ch == '3') return 7;
  if (ch == '4') return 8;
  if (ch == '5') return 9;
}
char antihash(long long int i) {
  string s = "RGBYW12345";
  return s[i];
}
long long int mark[5][5];
bool check(long long int x) {
  long long int i, j, p, q, r, s, t, tmp, a, b, c, d, f = 0;
  for (a = 0; a < 5; a++) {
    for (b = 0; b < 5; b++) {
      for (c = 0; c < 5; c++) {
        for (d = 0; d < 5; d++) {
          if (a == c and b == d) continue;
          if (mark[a][b] and mark[c][d]) {
            if (a == c) {
              if ((x & (1LL << (b + 5))) or (x & (1LL << (d + 5)))) {
                continue;
              } else {
                f = 1;
              }
            } else if (b == d) {
              if ((x & (1LL << a)) or (x & (1LL << c))) {
                continue;
              } else {
                f = 1;
              }
            } else {
              if ((x & (1LL << a)) or (x & (1LL << (b + 5))) or
                  (x & (1LL << c)) or (x & (1LL << (d + 5)))) {
                continue;
              } else {
                f = 1;
              }
            }
          }
        }
      }
    }
  }
  if (f) return false;
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ;
  long long int t = 1, n, i, j, k, len, x, y, z, c, f, flag, p, q, mx, mn, l, r,
                sum, ans, tmp, it, pos, avg, m, cnt;
  string s;
  char ch;
  vector<long long int> v;
  vector<pair<long long int, long long int>> vec;
  unordered_map<long long int, long long int> mappu;
  pair<long long int, long long int> pr;
  {
    f = 0;
    sum = 0;
    flag = 0;
    ans = 0;
    cnt = 0;
    v.clear();
    mappu.clear();
    vec.clear();
    cin >> n;
    memset(mark, 0, sizeof(mark));
    for (i = 0; i < n; i++) {
      cin >> s;
      l = hashval(s[0]);
      r = hashval(s[1]);
      mark[l][r - 5] = 1;
    }
    long long int x = 1LL << 10;
    ans = 1e9;
    for (i = 0; i < x; i++) {
      if (check(i)) ans = min(ans, (long long int)__builtin_popcount(i));
    }
    cout << ans << "\n";
  }
  return 0;
}
