#include <bits/stdc++.h>
using namespace std;
int ans = 25, a[105], b[105];
int n;
bool check(int msk1, int msk2) {
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (a[i] == a[j] && b[i] == b[j]) continue;
      bool a1 = (1 << a[i]) & msk1, a2 = (1 << a[j]) & msk1,
           b1 = (1 << b[i]) & msk2, b2 = (1 << b[j]) & msk2;
      if (a[i] == a[j] && !(b1 + b2))
        return 0;
      else if (b[i] == b[j] && !(a1 + a2))
        return 0;
      else if (!(a1 + a2 + b1 + b2))
        return 0;
    }
  }
  return 1;
}
void calc() {
  for (int i = 0; i < 32; i++)
    for (int j = 0; j < 32; j++)
      if (check(i, j))
        ans = min(ans, __builtin_popcount(i) + __builtin_popcount(j));
}
int main() {
  map<char, int> mp;
  mp['R'] = 0, mp['G'] = 1, mp['B'] = 2, mp['Y'] = 3, mp['W'] = 4;
  scanf("%d", &n);
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    a[i] = mp[s[0]], b[i] = s[1] - '1';
  }
  calc();
  cout << ans << endl;
  return 0;
}
