#include <bits/stdc++.h>
using namespace std;
const int place[6][6] = {{1, 2, 3, 4, 5, 6}, {2, 1, 5, 6, 3, 4},
                         {3, 1, 2, 6, 4, 5}, {4, 1, 3, 6, 5, 2},
                         {5, 1, 4, 6, 2, 3}, {6, 5, 4, 3, 2, 1}};
map<string, bool> p;
int a[10];
char str[10], g[10];
int ans;
void cal(char g[]) {
  if (p[g]) return;
  ans++;
  int i, j;
  char x[10];
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 6; j++) x[j] = g[place[i][j] - 1];
    x[6] = '\0';
    for (j = 0; j < 4; j++) {
      p[x] = true;
      char temp = x[1];
      x[1] = x[4];
      x[4] = x[3];
      x[3] = x[2];
      x[2] = temp;
    }
  }
}
int main() {
  int i;
  scanf("%s", str);
  for (i = 0; i < 6; i++) a[i] = i;
  do {
    for (i = 0; i < 6; i++) g[i] = str[a[i]];
    cal(g);
  } while (next_permutation(a, a + 6));
  printf("%d\n", ans);
  return 0;
}
