#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void checkMin(T &a, T b) {
  if (b < a) a = b;
}
template <typename T>
inline void checkMax(T &a, T b) {
  if (a < b) a = b;
}
int main() {
  bool o[5][5] = {};
  string mp = "RGBYW";
  int n;
  cin >> n;
  while (n--) {
    string s;
    cin >> s;
    int a = find((mp).begin(), (mp).end(), s[0]) - mp.begin();
    int b = s[1] - '1';
    o[a][b] = true;
  }
  int ans = 8;
  for (int m1 = 0; m1 < int(1 << 5); ++m1) {
    for (int m2 = 0; m2 < int(1 << 5); ++m2) {
      set<int> is;
      bool ok = true;
      for (int i = 0; i < int(5); ++i) {
        for (int j = 0; j < int(5); ++j) {
          if (o[i][j]) {
            int t = (m1 & (1 << i)) << 5 | (m2 & (1 << j));
            if (is.count(t)) {
              ok = false;
            }
            is.insert(t);
          }
        }
      }
      if (ok) {
        checkMin(ans, __builtin_popcount(m1 << 5 | m2));
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
