#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
char s[1000];
int k, n, ans = 10;
int t[1000], c[1000000];
set<int> v;
int check(int a) {
  memset(c, 0, sizeof(c));
  for (typeof(v.begin()) it = v.begin(); it != v.end(); it++) {
    c[a & (*it)]++;
    if (c[a & (*it)] > 1) return 0;
  }
  return 1;
}
int main() {
  cin >> n;
  t['R'] = 5;
  t['G'] = 6;
  t['B'] = 7;
  t['W'] = 8;
  t['Y'] = 9;
  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    int temp = 0;
    temp |= 1 << (s[1] - '1');
    temp |= 1 << t[s[0]];
    v.insert(temp);
  }
  for (int i = 0; i < (1 << 10); i++)
    if (check(i)) ans = min(ans, __builtin_popcount(i));
  cout << ans;
  return 0;
}
