#include <bits/stdc++.h>
using namespace std;
int main() {
  map<char, int> m1;
  map<int, int> m2;
  m1['R'] = 0;
  m1['O'] = 1;
  m1['Y'] = 2;
  m1['G'] = 3;
  m1['B'] = 4;
  m1['V'] = 5;
  m2[6] = 1;
  m2[33] = 2;
  m2[24] = 2;
  m2[222] = 6;
  m2[15] = 1;
  m2[123] = 3;
  m2[114] = 2;
  m2[1113] = 5;
  m2[1122] = 8;
  m2[11112] = 15;
  m2[111111] = 30;
  string s;
  cin >> s;
  int c[6] = {0};
  for (int i = 0; i < s.size(); i++) c[m1[s[i]]]++;
  sort(c, c + 6);
  int x = 0;
  for (int i = 0; i < 6; i++) {
    x *= 10;
    x += c[i];
  }
  cout << m2[x] << endl;
}
