#include <bits/stdc++.h>
using namespace std;
map<char, int> A;
bool cmp(int a, int b) { return a > b; }
int main() {
  A['R'] = 0, A['O'] = 1, A['Y'] = 2, A['G'] = 3, A['B'] = 4, A['V'] = 5;
  char s[100];
  int a[100] = {0, 0, 0, 0, 0, 0};
  scanf("%s", s);
  for (int i = 0; i < 6; i++) a[A[s[i]]]++;
  sort(a, a + 6, cmp);
  int ans;
  if (a[0] >= 5)
    ans = 1;
  else if (a[0] == 4)
    ans = 2;
  else if (a[0] == 3 && a[1] == 3)
    ans = 2;
  else if (a[0] == 3 && a[1] == 2 && a[2] == 1)
    ans = 3;
  else if (a[0] == 3 && a[1] == 1 && a[2] == 1 && a[3] == 1)
    ans = 5;
  else if (a[0] == 2 && a[1] == 2 && a[2] == 2)
    ans = 6;
  else if (a[0] == 2 && a[1] == 2 && a[2] == 1 && a[3] == 1)
    ans = 8;
  else if (a[0] == 2 && a[1] == 1 && a[2] == 1 && a[3] == 1 && a[4] == 1)
    ans = 15;
  else
    ans = 30;
  printf("%d\n", ans);
  return 0;
}
