#include <bits/stdc++.h>
using namespace std;
vector<string> c;
bool can_guess(int m) {
  string kind = "RGBYW12345";
  vector<string> my(c.size(), "  ");
  for (int i = 0; i < 10; ++i) {
    if (m & (1 << i)) {
      for (int j = 0; j < c.size(); ++j) {
        if (i < 5) {
          if (c[j][0] == kind[i]) {
            my[j][0] = kind[i];
          }
        } else {
          if (c[j][1] == kind[i]) {
            my[j][1] = kind[i];
          }
        }
      }
    }
  }
  for (int i = 0; i < c.size() - 1; ++i) {
    for (int j = i + 1; j < c.size(); ++j) {
      if (c[i] == c[j]) continue;
      bool diff = false;
      if (c[i][0] != c[j][0] && my[i][0] != my[j][0]) {
        diff = true;
      }
      if (c[i][1] != c[j][1] && my[i][1] != my[j][1]) {
        diff = true;
      }
      if (!diff) return false;
    }
  }
  return true;
}
int main() {
  int n;
  cin >> n;
  string card_in;
  for (int i = 0; i < n; ++i) {
    cin >> card_in;
    c.push_back(card_in);
  }
  int ans = 11;
  for (int i = 0; i < 1024; ++i) {
    if (can_guess(i)) {
      ans = min(ans, __builtin_popcount(i));
    }
  }
  cout << ans << endl;
  return 0;
}
