#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
const int inf = 0x3f3f3f3f;
char s[10];
int cnt[6];
int main() {
  ios_base::sync_with_stdio(false);
  gets(s);
  memset(cnt, 0, sizeof(cnt));
  for (int i = 0; i < 6; i++) {
    if (s[i] == 'R') {
      cnt[0]++;
    } else if (s[i] == 'O') {
      cnt[1]++;
    } else if (s[i] == 'Y') {
      cnt[2]++;
    } else if (s[i] == 'G') {
      cnt[3]++;
    } else if (s[i] == 'B') {
      cnt[4]++;
    } else
      cnt[5]++;
  }
  sort(cnt, cnt + 6);
  if (cnt[5] == 1) {
    cout << 30 << endl;
  }
  if (cnt[5] == 2 && cnt[4] == 1) {
    cout << 15 << endl;
  }
  if (cnt[5] == 2 && cnt[4] == 2 && cnt[3] == 1) {
    cout << 8 << endl;
  }
  if (cnt[5] == 2 && cnt[4] == 2 && cnt[3] == 2) {
    cout << 6 << endl;
  }
  if (cnt[5] == 3 && cnt[4] == 1) {
    cout << 5 << endl;
  }
  if (cnt[5] == 3 && cnt[4] == 2 && cnt[3] == 1) {
    cout << 3 << endl;
  }
  if (cnt[5] == 3 && cnt[4] == 3) {
    cout << 2 << endl;
  }
  if (cnt[5] == 4 && cnt[4] == 1) {
    cout << 2 << endl;
  }
  if (cnt[5] == 4 && cnt[4] == 2) {
    cout << 2 << endl;
  }
  if (cnt[5] == 5) {
    cout << 1 << endl;
  }
  if (cnt[5] == 6) {
    cout << 1 << endl;
  }
  return 0;
}
