#include <bits/stdc++.h>
using namespace std;
int a[6];
int main() {
  map<char, int> mp;
  mp['R'] = 0;
  mp['O'] = 1;
  mp['Y'] = 2;
  mp['G'] = 3;
  mp['B'] = 4;
  mp['V'] = 5;
  char str[7];
  cin >> str;
  for (int i = 0; i < 6; i++) a[mp[str[i]]]++;
  sort(a, a + 6);
  reverse(a, a + 6);
  int s;
  if (a[0] >= 5)
    s = 1;
  else if (a[0] == 4)
    s = 2;
  else if (a[1] == 3)
    s = 2;
  else if (a[0] == 3 && a[1] == 2)
    s = 3;
  else if (a[0] == 3)
    s = 5;
  else if (a[2] == 2)
    s = 6;
  else if (a[1] == 2)
    s = 8;
  else if (a[0] == 2)
    s = 15;
  else
    s = 30;
  cout << s;
  return 0;
}
