#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int main() {
  char f[6];
  int a[6];
  cin >> f;
  set<char> M;
  memset(a, 0, sizeof(a));
  for (int i = 0; i < 6; ++i) {
    M.insert(f[i]);
    switch (f[i]) {
      case 'B':
        a[0]++;
        break;
      case 'O':
        a[1]++;
        break;
      case 'V':
        a[2]++;
        break;
      case 'R':
        a[3]++;
        break;
      case 'Y':
        a[4]++;
        break;
      case 'G':
        a[5]++;
        break;
    }
  }
  int b[7] = {0, 0, 0, 0, 0, 0, 0};
  for (int i = 0; i < 6; ++i) b[a[i]]++;
  int i = 6;
  for (; !b[i]; --i)
    ;
  switch (M.size()) {
    case 1:
      cout << 1 << endl;
      break;
    case 6:
      cout << 30 << endl;
      break;
    case 2: {
      if (i == 5)
        cout << 1 << endl;
      else
        cout << 2 << endl;
      break;
    }
    case 3: {
      if (i == 4)
        cout << 2 << endl;
      else if (i == 3)
        cout << 3 << endl;
      else
        cout << 6 << endl;
      break;
    }
    case 4: {
      if (i == 2)
        cout << 8 << endl;
      else
        cout << 5 << endl;
      break;
    }
    case 5:
      cout << 15 << endl;
      break;
  }
  return 0;
}
