#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[10];
  gets(s);
  int i;
  int cnt[10];
  memset(cnt, 0, sizeof(cnt));
  for (i = 0; i <= 5; i++) {
    if (s[i] == 'R') {
      cnt[1]++;
    }
    if (s[i] == 'O') {
      cnt[2]++;
    }
    if (s[i] == 'Y') {
      cnt[3]++;
    }
    if (s[i] == 'G') {
      cnt[4]++;
    }
    if (s[i] == 'B') {
      cnt[5]++;
    }
    if (s[i] == 'V') {
      cnt[6]++;
    }
  }
  sort(cnt + 1, cnt + 7);
  if (cnt[6] == 6) {
    printf("1\n");
  }
  if (cnt[6] == 5 && cnt[5] == 1) {
    printf("1\n");
  }
  if (cnt[6] == 4 && cnt[5] == 1 && cnt[4] == 1) {
    printf("2\n");
  }
  if (cnt[6] == 4 && cnt[5] == 2) {
    printf("2\n");
  }
  if (cnt[6] == 3 && cnt[5] == 3) {
    printf("2\n");
  }
  if (cnt[6] == 3 && cnt[5] == 2 && cnt[4] == 1) {
    printf("3\n");
  }
  if (cnt[6] == 3 && cnt[5] == 1 && cnt[4] == 1 && cnt[3] == 1) {
    printf("5\n");
  }
  if (cnt[6] == 2 && cnt[5] == 1 && cnt[4] == 1 && cnt[3] == 1 && cnt[2] == 1) {
    printf("15\n");
  }
  if (cnt[6] == 2 && cnt[5] == 2 && cnt[4] == 1 && cnt[3] == 1) {
    printf("8\n");
  }
  if (cnt[6] == 2 && cnt[5] == 2 && cnt[4] == 2) {
    printf("6\n");
  }
  if (cnt[6] == 1 && cnt[5] == 1 && cnt[4] == 1 && cnt[3] == 1 && cnt[2] == 1 &&
      cnt[1] == 1) {
    printf("30\n");
  }
  return 0;
}
