#include <bits/stdc++.h>
using namespace std;
void sum(int x, int y, int z) {
  if (x == 1 && y == 1 && z == 1)
    cout << "30" << endl;
  else if (x == 2 && y == 1 && z == 1)
    cout << "15" << endl;
  else if (x == 3 && y == 1 && z == 1)
    cout << "5" << endl;
  else if (x == 4 && y == 1 && z == 1)
    cout << "2" << endl;
  else if (x == 5 && y == 1)
    cout << "1" << endl;
  else if (x == 6 && y == 0)
    cout << "1" << endl;
  else if (x == 2 && y == 2 && z == 1)
    cout << "8" << endl;
  else if (x == 2 && y == 2 && z == 2)
    cout << "6" << endl;
  else if (x == 3 && y == 2)
    cout << "3" << endl;
  else if (x == 4 && y == 2)
    cout << "2" << endl;
  else if (x == 3 && y == 3)
    cout << "2" << endl;
}
int main() {
  char color[6];
  int a[6];
  while (cin >> color) {
    memset(a, 0, sizeof(a));
    for (int i = 0; i < 6; i++) {
      if (color[i] == 'R')
        a[0]++;
      else if (color[i] == 'O')
        a[1]++;
      else if (color[i] == 'Y')
        a[2]++;
      else if (color[i] == 'G')
        a[3]++;
      else if (color[i] == 'B')
        a[4]++;
      else if (color[i] == 'V')
        a[5]++;
    }
    sort(a, a + 6);
    sum(a[5], a[4], a[3]);
  }
  return 0;
}
