#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int a[10], i;
  string s;
  cin >> s;
  memset(a, 0, sizeof(a));
  for (i = 0; i < 6; i++) {
    if (s[i] == 'R')
      a[0]++;
    else if (s[i] == 'O')
      a[1]++;
    else if (s[i] == 'Y')
      a[2]++;
    else if (s[i] == 'G')
      a[3]++;
    else if (s[i] == 'B')
      a[4]++;
    else
      a[5]++;
  }
  sort(a, a + 6);
  if (a[5] == 6 || a[5] == 5)
    cout << 1 << endl;
  else if (a[5] == 4 || (a[5] == 3 && a[4] == 3))
    cout << 2 << endl;
  else if (a[5] == 3 && a[4] == 2)
    cout << 3 << endl;
  else if (a[5] == 3 && a[4] == 1)
    cout << 5 << endl;
  else if (a[5] == 2 && a[4] == 2 && a[3] == 2)
    cout << 6 << endl;
  else if (a[5] == 2 && a[4] == 2 && a[3] == 1)
    cout << 8 << endl;
  else if (a[5] == 2 && a[4] == 1)
    cout << 15 << endl;
  else
    cout << 30 << endl;
  return 0;
}
