#include <bits/stdc++.h>
using namespace std;
int h[256];
bool visit[6];
vector<int> v;
void Init() {
  h['R'] = 0;
  h['O'] = 1;
  h['Y'] = 2;
  h['G'] = 3;
  h['B'] = 4;
  h['V'] = 5;
}
int c[6], f[6], r[6];
char s[10];
int Cal() {
  int ret = 0;
  for (int i = 0; i < 6; i++) ret = ret * 6 + f[i];
  return ret;
}
void R1() {
  int t = f[0];
  f[0] = f[1];
  f[1] = f[2];
  f[2] = f[3];
  f[3] = t;
}
void R2() {
  int t = f[0];
  f[0] = f[5];
  f[5] = f[2];
  f[2] = f[4];
  f[4] = t;
}
void R3() {
  int t = f[3];
  f[3] = f[4];
  f[4] = f[1];
  f[1] = f[5];
  f[5] = t;
}
bool Exist(int val) {
  for (int i = 0; i < v.size(); i++)
    if (v[i] == val) return true;
  return false;
}
void Func() {
  bool flag = false;
  for (int i = 0; i < 4; i++) {
    R1();
    for (int j = 0; j < 4; j++) {
      R2();
      for (int k = 0; k < 4; k++) {
        R3();
        int val = Cal();
        if (Exist(val)) {
          flag = true;
          goto R;
        }
      }
    }
  }
R:
  if (!flag) v.push_back(Cal());
}
void DFS(int p) {
  if (p == 6) {
    memcpy(r, f, sizeof(f));
    Func();
    memcpy(f, r, sizeof(r));
    return;
  }
  for (int i = 0; i < 6; i++) {
    if (!visit[i]) {
      f[p] = c[i];
      visit[i] = true;
      DFS(p + 1);
      visit[i] = false;
    }
  }
}
int main() {
  Init();
  while (scanf("%s", s) != EOF) {
    for (int i = 0; s[i]; i++) c[i] = h[s[i]];
    v.clear();
    memset(visit, 0, sizeof(visit));
    DFS(0);
    printf("%d\n", v.size());
  }
  return 0;
}
