#include <bits/stdc++.h>
using namespace std;
bool differentiable(const pair<int, int> &c1, const pair<int, int> &c2,
                    int questionMask) {
  int mask1 = (1 << (c1.first + 5)) + (1 << c1.second);
  int mask2 = (1 << (c2.first + 5)) + (1 << c2.second);
  int mask = mask1 ^ mask2;
  return (mask & questionMask);
}
int bitcnt(int mask) {
  int ans = 0;
  while (mask != 0) {
    mask &= mask - 1;
    ans++;
  }
  return ans;
}
bool allDifferentiable(const vector<pair<int, int> > &cards, int mask) {
  for (int i = 0; i < cards.size(); i++) {
    for (int j = i + 1; j < cards.size(); j++) {
      if (!differentiable(cards[i], cards[j], mask)) return false;
    }
  }
  return true;
}
int main() {
  int n;
  string tmp;
  string colors = "RGBYW";
  while (cin >> n) {
    vector<pair<int, int> > cards;
    for (int i = 0; i < n; i++) {
      cin >> tmp;
      cards.push_back(make_pair(colors.find(tmp[0]), tmp[1] - '1'));
    }
    sort(cards.begin(), cards.end());
    cards.erase(unique(cards.begin(), cards.end()), cards.end());
    int ans = 20;
    for (int mask = 0; mask < (1 << 10); mask++) {
      if (allDifferentiable(cards, mask)) ans = min(ans, bitcnt(mask));
    }
    cout << ans << endl;
  }
}
