#include <bits/stdc++.h>
using namespace std;
bool was[11];
string s;
int n, k, ans, a[111];
void go(int len) {
  if (len == 10) {
    bool ok = true;
    for (int i = 0; i < n; ++i)
      for (int j = 0; j < n; ++j)
        if (a[i] != a[j]) {
          if (!((a[i] / 10 != a[j] / 10 &&
                 (was[a[i] / 10] || was[a[j] / 10])) ||
                (a[i] % 10 != a[j] % 10 && (was[a[i] % 10] || was[a[j] % 10]))))
            ok = false;
        }
    if (ok) {
      int col = 0;
      for (int i = 0; i < 10; ++i)
        if (was[i]) ++col;
      ans = min(ans, col);
    }
    return;
  }
  was[len] = true;
  go(len + 1);
  was[len] = false;
  go(len + 1);
}
int main() {
  scanf("%d", &n);
  ans = n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    int x = (int)(s[1]) - 49;
    if (s[0] == 'R')
      x = x + 50;
    else if (s[0] == 'G')
      x = x + 60;
    else if (s[0] == 'B')
      x = x + 70;
    else if (s[0] == 'Y')
      x = x + 80;
    else
      x = x + 90;
    a[i] = x;
  }
  go(0);
  cout << ans;
  return 0;
}
