#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1234567890000")
using namespace std;
int dx[] = {0, 0, -1, 1, 1, -1, 1, -1};
int dy[] = {1, -1, 0, 0, 1, 1, -1, -1};
void rotateX(int A[]) {
  int B[6], i;
  for (i = 0; i < 6; i++) {
    B[i] = A[i];
  }
  A[0] = B[0];
  A[1] = B[1];
  A[2] = B[5];
  A[4] = B[2];
  A[3] = B[4];
  A[5] = B[3];
}
void rotateZ(int A[]) {
  int B[6], i;
  for (i = 0; i < 6; i++) {
    B[i] = A[i];
  }
  A[0] = B[4];
  A[4] = B[1];
  A[1] = B[5];
  A[5] = B[0];
  A[3] = B[3];
  A[2] = B[2];
}
int vis[6][6][6][6][6][6] = {0};
void dfs(int A[]) {
  vis[A[0]][A[1]][A[2]][A[3]][A[4]][A[5]] = 1;
  int B[6], i;
  for (i = 0; i < 6; i++) {
    B[i] = A[i];
  }
  rotateX(B);
  if (vis[B[0]][B[1]][B[2]][B[3]][B[4]][B[5]] == 0) {
    dfs(B);
  }
  for (i = 0; i < 6; i++) {
    B[i] = A[i];
  }
  rotateZ(B);
  if (vis[B[0]][B[1]][B[2]][B[3]][B[4]][B[5]] == 0) {
    dfs(B);
  }
}
int main() {
  int mp[255] = {0}, i;
  string str = "ROYGBV";
  for (i = 0; i < str.length(); i++) {
    mp[str[i]] = i;
  }
  string s2;
  cin >> s2;
  int A[6], per[6] = {0, 1, 2, 3, 4, 5};
  int cnt = 0;
  do {
    for (i = 0; i < s2.length(); i++) {
      A[per[i]] = mp[s2[i]];
    }
    if (vis[A[0]][A[1]][A[2]][A[3]][A[4]][A[5]]) continue;
    cnt++;
    dfs(A);
  } while (next_permutation(per, per + 6));
  cout << cnt << endl;
  return 0;
}
