#include <bits/stdc++.h>
using namespace std;
long long MOD = 1e9 + 7;
long long MAX = 1e17;
int cnt[26];
void tobinary(int a, vector<char> &s) {
  if (a / 2 != 0) {
    tobinary(a / 2, s);
  }
  s.push_back((a % 2) + '0');
}
map<char, int> ID;
int main() {
  ios_base::sync_with_stdio(0);
  ;
  int n;
  cin >> n;
  ID['R'] = 0, ID['B'] = 1, ID['G'] = 2, ID['Y'] = 3, ID['W'] = 4;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    cnt[(5 * (ID[s[0]])) + (s[1] - '1')]++;
  }
  set<int> ans;
  for (int i = 0; i < (pow(2, 10)); i++) {
    vector<char> temp;
    tobinary(i, temp);
    reverse(temp.begin(), temp.end());
    while (temp.size() < 10) {
      temp.push_back('0');
    }
    reverse(temp.begin(), temp.end());
    int num = 0;
    bool pos = true;
    for (int j = 0; j < temp.size(); j++) {
      if (temp[j] == '1') num++;
    }
    for (int j = 0; j < 25; j++) {
      for (int k = j + 1; k < 25; k++) {
        bool pos1 = true, pos2 = true;
        if (cnt[j] != 0 and cnt[k] != 0 and
            ((temp[j / 5] == '0' and temp[k / 5] == '0') or
             ((j / 5) == (k / 5))))
          pos1 = false;
        if (cnt[j] != 0 and cnt[k] != 0 and
            ((temp[5 + (j % 5)] == '0' and temp[5 + (k % 5)] == '0') or
             (5 + (j % 5) == 5 + (k % 5))))
          pos2 = false;
        if ((!pos1 and !pos2)) pos = false;
      }
    }
    if (pos) ans.insert(num);
  }
  cout << *(ans.begin());
}
