#include <bits/stdc++.h>
using namespace std;
bool u[6][6][6][6][6][6];
int d[2][6] = {{0, 3, 1, 4, 2, 5}, {2, 1, 5, 0, 4, 3}};
int cc[256];
int i, cnt, a[6] = {0};
void go() {
  int bg = 0, nd = 1, i, j;
  int o[1500][6] = {{0}};
  int bf[6];
  u[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]] = 1;
  for (i = 0; i < 6; i++) o[1][i] = a[i];
  while (bg < nd) {
    bg++;
    for (j = 0; j < 2; j++) {
      for (i = 0; i < 6; i++) bf[i] = o[bg][d[j][i]];
      if (!u[bf[0]][bf[1]][bf[2]][bf[3]][bf[4]][bf[5]]) {
        nd++;
        for (i = 0; i < 6; i++) o[nd][i] = bf[i];
        u[bf[0]][bf[1]][bf[2]][bf[3]][bf[4]][bf[5]] = 1;
      }
    }
  }
}
int main() {
  cc['R'] = 0;
  cc['O'] = 1;
  cc['Y'] = 2;
  cc['G'] = 3;
  cc['B'] = 4;
  cc['V'] = 5;
  char c;
  for (i = 0; i < 6; i++) {
    scanf("%c", &c);
    a[i] = cc[(int)c];
  }
  sort(a, a + 6);
  cnt = 0;
  do {
    if (!u[a[0]][a[1]][a[2]][a[3]][a[4]][a[5]]) {
      cnt++;
      go();
    }
  } while (next_permutation(a, a + 6));
  cout << cnt;
  return 0;
}
