#include <bits/stdc++.h>
using namespace std;
string aa;
int visited[100];
char str[7] = {'R', 'O', 'Y', 'G', 'B', 'V'};
int a[100];
int main() {
  cin >> aa;
  int N = 0;
  for (int j = 0; j <= 5; j++) {
    visited[j] = 0;
    for (int l = 0; l <= aa.length() - 1; l++) {
      if (str[j] == aa[l]) {
        visited[j]++;
      }
    }
  }
  int count = 1;
  for (int j = 0; j <= 5; j++) {
    if (visited[j] != 0) a[count++] = visited[j];
  }
  count--;
  if (count == 1) cout << 1 << endl;
  if (count == 6) cout << 30 << endl;
  if (count == 5) cout << 15 << endl;
  if (count == 4) {
    int flag = 0;
    for (int j = 1; j <= count; j++) {
      if (a[j] == 3) {
        flag = 1;
        break;
      }
    }
    if (!flag)
      cout << 8 << endl;
    else
      cout << 5 << endl;
  }
  if (count == 3) {
    int flag = 1;
    for (int j = 1; j <= count; j++) {
      if (a[j] == 4) {
        flag = 0;
        break;
      }
      if (a[j] == 3) {
        flag = 2;
        break;
      }
    }
    if (flag == 1)
      cout << 6 << endl;
    else if (flag == 2)
      cout << 3 << endl;
    else if (flag == 0)
      cout << 2 << endl;
  }
  if (count == 2) {
    int ff = 0;
    for (int j = 1; j <= count; j++) {
      if (a[j] == 3) {
        cout << 2 << endl;
        break;
      }
      if (a[j] == 1) {
        cout << 1 << endl;
        break;
      }
      if (a[j] == 2) {
        cout << 2 << endl;
        break;
      }
    }
  }
  return 0;
}
