#include <bits/stdc++.h>
using namespace std;
int r[25][6] = {
    {0, 0, 0, 0, 0, 0}, {1, 2, 3, 4, 5, 6}, {1, 2, 4, 5, 6, 3},
    {1, 2, 5, 6, 3, 4}, {1, 2, 6, 3, 4, 5}, {2, 1, 5, 4, 3, 6},
    {2, 1, 4, 3, 6, 5}, {2, 1, 3, 6, 5, 4}, {2, 1, 6, 5, 4, 3},
    {5, 3, 1, 4, 2, 6}, {5, 3, 4, 2, 6, 1}, {5, 3, 2, 6, 1, 4},
    {5, 3, 6, 1, 4, 2}, {3, 5, 2, 4, 1, 6}, {3, 5, 4, 1, 6, 2},
    {3, 5, 1, 6, 2, 4}, {3, 5, 6, 2, 4, 1}, {4, 6, 3, 2, 5, 1},
    {4, 6, 2, 5, 1, 3}, {4, 6, 5, 1, 3, 2}, {4, 6, 1, 3, 2, 5},
    {6, 4, 1, 5, 2, 3}, {6, 4, 5, 2, 3, 1}, {6, 4, 2, 3, 1, 5},
    {6, 4, 3, 1, 5, 2},
};
struct Node {
  int a[7];
} node[500], now;
char ch[8];
int a[8];
int ans;
int cnt;
int get(char c) {
  if (c == 'R') return 1;
  if (c == 'O') return 2;
  if (c == 'Y') return 3;
  if (c == 'G') return 4;
  if (c == 'B') return 5;
  return 6;
}
bool slove2(int k) {
  for (int i = 1; i <= 24; i++) {
    int f = 0;
    for (int j = 0; j < 6; j++) {
      if (node[k].a[r[i][j]] != now.a[j + 1]) {
        f = 1;
        break;
      }
    }
    if (f == 0) return true;
  }
  return false;
}
bool judge() {
  for (int i = 1; i <= ans; i++) {
    if (slove2(i)) return false;
  }
  for (int i = 1; i <= 6; i++) {
    node[ans + 1].a[i] = now.a[i];
  }
  return true;
}
void slove() {
  int b[7];
  for (int i = 1; i <= 6; i++) {
    b[i] = i;
  }
  do {
    for (int i = 1; i <= 6; i++) {
      now.a[b[i]] = a[i];
    }
    if (judge()) ans++;
  } while (next_permutation(b + 1, b + 7));
}
int main() {
  scanf("%s", ch);
  for (int i = 0; i <= 5; i++) {
    a[i + 1] = get(ch[i]);
  }
  ans = 0;
  slove();
  printf("%d\n", ans);
}
