#include <bits/stdc++.h>
using namespace std;
int main() {
  char arr[] = {'R', 'O', 'Y', 'B', 'G', 'V'};
  string str;
  int arr2[6];
  memset(arr2, 0, sizeof(int) * 6);
  cin >> str;
  int i, j, k;
  for (int i = 0; i < str.size(); i += 1) {
    for (int j = 0; j < 6; j += 1) {
      if (str[i] == arr[j]) {
        arr2[j]++;
      }
    }
  }
  sort(arr2, arr2 + 6);
  if (arr2[5] == 6 || arr2[5] == 5) {
    cout << "1\n";
    return 0;
  }
  if (arr2[5] == 4) {
    cout << "2\n";
    return 0;
  }
  if (arr2[5] == 1) {
    cout << "30\n";
  }
  if (arr2[5] == 3) {
    if (arr2[4] == 3)
      cout << "2\n";
    else if (arr2[4] == 2) {
      cout << "3\n";
      return 0;
    } else {
      cout << "5\n";
      return 0;
    }
  }
  if (arr2[5] == 2) {
    if (arr2[4] == 1)
      cout << "15\n";
    else {
      if (arr2[3] == 1) {
        cout << "8\n";
      } else {
        cout << "6\n";
      }
    }
  }
}
