#include <bits/stdc++.h>
using namespace std;
int n;
string s;
vector<pair<int, int> > ve;
char L[] = "RGBYW";
map<char, int> ml;
int f(int s, int a, int b) {
  int fa, fb;
  int ba, bb;
  ba = (s & (1 << (a)));
  bb = (s & (1 << (b + 5)));
  fa = (ba > 0 ? a : 6);
  fb = (bb > 0 ? b : 6);
  return fa + fb * 6;
}
bool g(int s) {
  int fx;
  map<int, int> ma;
  for (int i = 0; i < ve.size(); i++) {
    fx = f(s, ve[i].first, ve[i].second);
    if (++ma[fx] > 1) {
      return false;
    }
  }
  return true;
}
vector<pair<int, int> > unique(vector<pair<int, int> > v) {
  set<pair<int, int> > s;
  vector<pair<int, int> > res;
  for (int i = 0; i < v.size(); i++) {
    s.insert(v[i]);
  }
  for (set<pair<int, int> >::iterator it = s.begin(); it != s.end(); it++) {
    res.push_back(*it);
  }
  return res;
}
int main() {
  for (int i = 0; i < 5; i++) {
    ml[L[i]] = i;
  }
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s;
    ve.push_back(make_pair(ml[s[0]], s[1] - '1'));
  }
  ve = unique(ve);
  int w = 1 << 10;
  bool b;
  int num = 0, res = 10;
  for (int s = 0; s < w; s++) {
    num = 0;
    for (int i = 0; i < 10; i++) {
      if ((s & (1 << i)) > 0) num++;
    }
    if (g(s)) {
      res = min(res, num);
    }
  }
  cout << res << endl;
  return 0;
}
