#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int mod = 1e9 + 7;
const int maxn = 1e3 + 7;
const double pi = acos(-1.0);
const int v2 = (mod + 1) / 2;
const double eps = 5e-6;
char s[6], modle[6] = {'R', 'O', 'Y', 'G', 'B', 'V'};
int v[6];
int used[24][6] = {
    {1, 2, 3, 4, 5, 6}, {6, 5, 4, 3, 2, 1}, {1, 3, 4, 5, 2, 6},
    {6, 4, 3, 2, 5, 1}, {1, 4, 5, 2, 3, 6}, {6, 3, 2, 5, 4, 1},
    {1, 5, 2, 3, 4, 6}, {6, 2, 5, 4, 3, 1}, {2, 6, 3, 1, 5, 4},
    {4, 1, 3, 6, 5, 2}, {2, 3, 1, 5, 6, 4}, {4, 3, 6, 5, 1, 2},
    {2, 1, 5, 6, 3, 4}, {4, 6, 5, 1, 3, 2}, {2, 5, 6, 3, 1, 4},
    {4, 5, 1, 3, 6, 2}, {3, 2, 6, 4, 1, 5}, {5, 4, 6, 2, 1, 3},
    {3, 6, 4, 1, 2, 5}, {5, 6, 2, 1, 4, 3}, {3, 4, 1, 2, 6, 5},
    {5, 2, 1, 4, 6, 3}, {3, 1, 2, 6, 4, 5}, {5, 1, 4, 6, 2, 3},
};
set<string> st;
void did(string s) {
  string res = s;
  for (int i = 0; i < 24; i++) {
    string tmp = "";
    for (int j = 0; j < 6; j++) {
      tmp += s[used[i][j] - 1];
    }
    if (res.compare(tmp) > 0) {
      res = tmp;
    }
  }
  st.insert(res);
}
void dfs(int now, string ns) {
  if (now == 6) {
    did(ns);
    return;
  }
  for (int i = 0; i < 6; i++) {
    if (v[i] != 0) {
      v[i]--;
      dfs(now + 1, ns + modle[i]);
      v[i]++;
    }
  }
}
int main() {
  scanf("%s", s);
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) {
      if (modle[j] == s[i]) {
        v[j]++;
      }
    }
  }
  dfs(0, "");
  cout << st.size() << endl;
  return 0;
}
