#include <bits/stdc++.h>
using namespace std;
const int MAX1 = 2200 + 12;
const int MAX2 = 1300 + 12;
char out[MAX1][MAX2];
char hints[10] = {'R', 'G', 'B', 'Y', 'W', '1', '2', '3', '4', '5'};
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> cards(n);
  vector<vector<char>> hintsP(n);
  for (int i = 0; i < n; i++) {
    cin >> cards[i];
  }
  int min = 10;
  for (int bitset = 0; bitset < 1024; bitset++) {
    for (int i = 0; i < n; i++) {
      hintsP[i] = vector<char>();
    }
    int testbit = 1;
    int bitsSet = 0;
    for (int j = 0; j < 10; j++) {
      if (bitset & testbit) {
        for (int i = 0; i < n; i++) {
          if (cards[i][0] == hints[j] || cards[i][1] == hints[j]) {
            hintsP[i].push_back(hints[j]);
          }
        }
        bitsSet++;
      }
      testbit <<= 1;
    }
    if (bitsSet < min) {
      bool succ = true;
      for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
          if (cards[i] != cards[j]) {
            if (hintsP[i].size() == hintsP[j].size()) {
              bool succ2 = false;
              for (int k = 0; k < hintsP[i].size(); k++) {
                if (hintsP[i][k] != hintsP[j][k]) {
                  succ2 = true;
                }
              }
              if (!succ2) {
                succ = false;
              }
            }
          }
        }
      }
      if (succ) {
        min = bitsSet;
      }
    }
  }
  cout << min;
}
