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