#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization("O3")
#pragma GCC optimization("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const int mod = 1000000007;
const int inf = 1000000009;
const long long INF = 1000000000000000009;
const long long big = 1000000000000000;
const long double eps = 0.000000000000000000001;
using namespace std;
map<string, int> M;
vector<pair<int, int> > W;
int dostan(char x) {
  if (x == 'R') return 0;
  if (x == 'B') return 1;
  if (x == 'W') return 2;
  if (x == 'G') return 3;
  return 4;
}
bool check(int x, int y) {
  for (int i = 0; i < W.size(); i++) {
    for (int j = i + 1; j < W.size(); j++) {
      if (((x & (1 << W[i].first) || x & (1 << W[j].first)) &&
           W[i].first != W[j].first) ||
          ((y & (1 << W[i].second) || y & (1 << W[j].second)) &&
           W[i].second != W[j].second))
        continue;
      return 0;
    }
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string a;
    cin >> a;
    if (!M[a]) W.push_back(make_pair(dostan(a[0]), a[1] - '1'));
    M[a] = 1;
  }
  int wynik = inf;
  for (int i = 0; i < (1 << 5); i++) {
    for (int j = 0; j < (1 << 5); j++) {
      if (check(i, j)) {
        wynik = min(wynik, __builtin_popcount(i) + __builtin_popcount(j));
      }
    }
  }
  cout << wynik;
  return 0;
}
