#include <bits/stdc++.h>
using namespace std;
const int MAXINT = -1u >> 1;
const double PI = acos(-1.0);
const double EPS = 1e-9;
int main() {
  char c[10];
  int ar[10];
  for (int i = 0; i < 10; i++) {
    ar[i] = 0;
  }
  int cnt = 0;
  for (int i = 0; i < 6; i++) {
    cin >> c[i];
    if (c[i] == 'R') ar[0]++;
    if (c[i] == 'O') ar[1]++;
    if (c[i] == 'Y') ar[2]++;
    if (c[i] == 'G') ar[3]++;
    if (c[i] == 'B') ar[4]++;
    if (c[i] == 'V') ar[5]++;
  }
  sort(ar, ar + 6);
  for (int i = 0; i < 6; i++) {
    if (ar[i] != 0) cnt++;
  }
  if (cnt == 1) {
    cout << 1 << endl;
  }
  if (cnt == 2) {
    if (ar[4] == 1 && ar[5] == 5) cout << 1 << endl;
    if (ar[4] == 2 && ar[5] == 4) cout << 2 << endl;
    if (ar[4] == 3 && ar[5] == 3) cout << 2 << endl;
  }
  if (cnt == 3) {
    if (ar[3] == 1 && ar[4] == 1 && ar[5] == 4) cout << 2 << endl;
    if (ar[3] == 1 && ar[4] == 2 && ar[5] == 3) cout << 3 << endl;
    if (ar[3] == 2 && ar[4] == 2 && ar[5] == 2) cout << 6 << endl;
  }
  if (cnt == 4) {
    if (ar[2] == 1 && ar[3] == 1 && ar[4] == 1 && ar[5] == 3) cout << 5 << endl;
    if (ar[2] == 1 && ar[3] == 1 && ar[4] == 2 && ar[5] == 2) cout << 8 << endl;
  }
  if (cnt == 5) cout << 15 << endl;
  if (cnt == 6) cout << 30 << endl;
  return 0;
}
