#include <bits/stdc++.h>
using namespace std;
int cnt[6];
int p[100][6], m[6], sz;
int eq(int idx) {
  int r = 0;
  int a[3][3] = {{0, 1, 2}, {1, 2, 0}, {2, 0, 1}};
  int b[4][4] = {{2, 3, 4, 5}, {4, 5, 3, 2}, {3, 2, 5, 4}, {5, 4, 2, 3}};
  for (int i = 0; i < 3; i++) {
    int t = 0;
    int m1[6];
    for (int j = 0; j < 3; j++) {
      m1[2 * j] = m[2 * a[i][j]];
      m1[2 * j + 1] = m[2 * a[i][j] + 1];
    }
    if (m1[0] == p[idx][0] && m1[1] == p[idx][1]) {
      for (int i = 0; i < 4; i++) {
        t = 0;
        for (int j = 0; j < 4; j++)
          if (p[idx][j + 2] == m1[b[i][j]]) t++;
        if (t == 4) return true;
      }
    }
    if (m1[0] == p[idx][1] && m1[1] == p[idx][0]) {
      swap(m1[3], m1[2]);
      for (int i = 0; i < 4; i++) {
        t = 0;
        for (int j = 0; j < 4; j++)
          if (p[idx][j + 2] == m1[b[i][j]]) t++;
        if (t == 4) return true;
      }
    }
  }
  return false;
}
void f(int k) {
  if (k == 3) {
    for (int i = 0; i < sz; i++) {
      if (eq(i)) return;
    }
    if (m[0] == m[1]) {
      swap(m[2], m[3]);
      for (int i = 0; i < sz; i++) {
        if (eq(i)) {
          swap(m[2], m[3]);
          return;
        }
      }
      swap(m[2], m[3]);
    }
    for (int i = 0; i < 6; i++) p[sz][i] = m[i];
    sz++;
    return;
  }
  int i = 0, j;
  while (!cnt[i]) i++;
  cnt[i]--;
  j = i;
  m[2 * k] = i;
  while (j < 6) {
    if (cnt[j]) {
      cnt[j]--;
      m[2 * k + 1] = j;
      f(k + 1);
      if (k == 2) {
        swap(m[4], m[5]);
        f(k + 1);
        swap(m[4], m[5]);
      }
      cnt[j]++;
    }
    j++;
  }
  cnt[i]++;
}
int main() {
  string s = "ROYGBV";
  string in;
  cin >> in;
  map<char, int> mp;
  for (int i = 0; i < s.length(); i++) {
    mp[s[i]] = i;
    cnt[i] = 0;
  }
  for (int i = 0; i < 6; i++) cnt[mp[in[i]]]++;
  sz = 0;
  f(0);
  cout << sz << endl;
  return 0;
}
