#include <bits/stdc++.h>
using namespace std;
const int to[3][6] = {
    {2, 3, 4, 1, 5, 6}, {1, 5, 3, 6, 4, 2}, {5, 2, 6, 4, 3, 1}};
struct states {
  int pos[6];
};
class cmp {
 public:
  bool operator()(const states& x, const states& y) {
    for (int i = 0; i < 6; i++)
      if (x.pos[i] != y.pos[i]) return x.pos[i] < y.pos[i];
    return 0;
  }
};
set<states, cmp> st, ans;
queue<states> que;
void bfs() {
  states tmp;
  for (int i = 0; i < 6; i++) tmp.pos[i] = i + 1;
  que.push(tmp);
  st.insert(tmp);
  while (!que.empty()) {
    states now = que.front();
    que.pop();
    for (int i = 0; i < 3; i++) {
      states newst = now;
      for (int j = 0; j < 6; j++) newst.pos[j] = to[i][newst.pos[j] - 1];
      if (st.find(newst) == st.end()) {
        st.insert(newst);
        que.push(newst);
      }
    }
  }
}
char s[7], a[6];
int main() {
  bfs();
  gets(s);
  for (int i = 0; i < 6; i++) {
    if (s[i] == 'R') a[i] = 0;
    if (s[i] == 'O') a[i] = 1;
    if (s[i] == 'Y') a[i] = 2;
    if (s[i] == 'G') a[i] = 3;
    if (s[i] == 'B') a[i] = 4;
    if (s[i] == 'V') a[i] = 5;
  }
  sort(a, a + 6);
  do {
    states tmp;
    for (int i = 0; i < 6; i++) tmp.pos[i] = a[i];
    bool flag = 1;
    for (set<states>::iterator it = st.begin(); it != st.end(); it++) {
      states newst;
      for (int i = 0; i < 6; i++) newst.pos[i] = tmp.pos[(*it).pos[i] - 1];
      if (ans.find(newst) != ans.end()) {
        flag = 0;
        break;
      }
    }
    if (flag) ans.insert(tmp);
  } while (next_permutation(a, a + 6));
  printf("%d\n", ans.size());
  return 0;
}
