#include <bits/stdc++.h>
using namespace std;
char s[6] = {'R', 'O', 'Y', 'G', 'B', 'V'};
int a[6];
string jg;
int main() {
  char ys[6];
  int i, j;
  while (scanf("%s", ys) != EOF) {
    memset(a, 0, sizeof(a));
    for (i = 0; i < strlen(ys); i++) {
      for (j = 0; j < 6; j++)
        if (ys[i] == s[j]) break;
      a[j]++;
    }
    sort(a, a + 6);
    i = 0;
    while (a[i] == 0) i++;
    jg = "";
    for (j = 0; i < 6; i++, j++) {
      jg = jg + char(a[i] + '0');
    }
    if (jg == "111111")
      printf("30\n");
    else if (jg == "11112")
      printf("15\n");
    else if (jg == "1113")
      printf("5\n");
    else if (jg == "1122")
      printf("8\n");
    else if (jg == "114")
      printf("2\n");
    else if (jg == "15")
      printf("1\n");
    else if (jg == "24")
      printf("2\n");
    else if (jg == "33")
      printf("2\n");
    else if (jg == "6")
      printf("1\n");
    else if (jg == "222")
      printf("6\n");
    else if (jg == "123")
      printf("3\n");
  }
}
