#include <bits/stdc++.h>
using namespace std;
int n;
vector<pair<int, int> > x;
bool valid(int m) {
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      if (x[i].first == x[j].first && x[i].second == x[j].second) continue;
      bool d1, d2, d3, d4;
      d1 = ((m >> x[i].first) & 1);
      d2 = ((m >> x[j].first) & 1);
      d3 = ((m >> x[i].second) & 1);
      d4 = ((m >> x[j].second) & 1);
      if ((d1 || d2) && x[i].first != x[j].first) continue;
      if ((d3 || d4) && x[i].second != x[j].second) continue;
      return false;
    }
  return true;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  for (int i = 0; i < n; i++) {
    char col, val;
    int idx;
    cin >> col >> val;
    if (col == 'R')
      idx = 0;
    else if (col == 'G')
      idx = 1;
    else if (col == 'B')
      idx = 2;
    else if (col == 'Y')
      idx = 3;
    else if (col == 'W')
      idx = 4;
    x.push_back(make_pair(idx, 5 + val - '1'));
  }
  int ans = 11;
  for (int i = 0; i < (1 << 10); i++) {
    int bitcnt = 0;
    for (int j = 0; j < 10; j++)
      if ((i >> j) & 1) bitcnt++;
    if (bitcnt >= ans) continue;
    if (valid(i)) ans = bitcnt;
  }
  cout << ans << endl;
  return 0;
}
