#include <bits/stdc++.h>
int result = 0, hash[10000000];
void swap(int *a, int *b) {
  int c;
  c = *a;
  *a = *b;
  *b = c;
}
void sort_up(int *a, int from, int to) {
  int i, j;
  for (i = from; i < to; i++)
    for (j = from; j < to - 1; j++)
      if (a[j] > a[j + 1]) swap(&a[j], &a[j + 1]);
}
int take_hash(int *a, int n) {
  int x = 0, i;
  x = a[0] * 100000 + a[1] * 10000 + a[2] * 1000 + a[3] * 100 + a[4] * 10 +
      a[5];
  return x;
}
int check_combination(int *a, int n) {
  int k, i, j, x, flag, h, res = 1;
  for (k = 0; k < 4; k++) {
    for (i = 0; i < 4; i++) {
      for (j = 0; j < 4; j++) {
        h = take_hash(a, 6);
        if (hash[h]) res = 0;
        x = a[3];
        a[3] = a[2];
        a[2] = a[1];
        a[1] = a[0];
        a[0] = x;
      }
      x = a[1];
      a[1] = a[5];
      a[5] = a[3];
      a[3] = a[4];
      a[4] = x;
    }
    x = a[5];
    a[5] = a[0];
    a[0] = a[4];
    a[4] = a[2];
    a[2] = x;
  }
  return res;
}
int all_combinations(int *a, int n) {
  int i, j, max = -1, indA, indB, not_exist;
  not_exist = check_combination(a, n);
  if (not_exist) {
    hash[take_hash(a, 6)] = 1;
    result++;
  }
  for (i = n - 2; i >= 0; i--)
    for (j = n - 1; j >= i + 1; j--)
      if (a[i] < a[j] && i > max) {
        indA = i;
        indB = j;
        max = indA;
      }
  if (max >= 0) {
    swap(&a[indA], &a[indB]);
    sort_up(a, indA + 1, 6);
    return 1;
  } else
    return 0;
}
int main() {
  int i;
  char x;
  int a[6];
  for (i = 0; i < 1000000; i++) hash[i] == 0;
  for (i = 0; i < 6; i++) {
    scanf("%c", &x);
    if (x == 'R')
      a[i] = 1;
    else if (x == 'O')
      a[i] = 2;
    else if (x == 'Y')
      a[i] = 3;
    else if (x == 'G')
      a[i] = 4;
    else if (x == 'B')
      a[i] = 5;
    else if (x == 'V')
      a[i] = 6;
  }
  sort_up(a, 0, 6);
  while (all_combinations(a, 6)) {
  }
  printf("%d", result);
  return 0;
}
