#include <bits/stdc++.h>
using namespace std;
const int a1[2][6] = {{1, 3, 4, 5, 2, 6}, {3, 2, 6, 4, 1, 5}};
int i, j, k, n, m;
int a[10], f[10];
char p[10];
string s;
set<string> yao, laji;
void sou(string a, int ty) {
  if (laji.count(a)) return;
  int i, j;
  if (ty) laji.insert(a);
  for (i = 0; i <= 1; i++) {
    string b;
    for (j = 0; j <= 5; j++) b += a[a1[i][j] - 1];
    sou(b, 1);
  }
}
void dfs(int x, string a) {
  if (x > 6) {
    if (!laji.count(a)) {
      yao.insert(a);
      sou(a, 0);
    }
    return;
  }
  int i;
  for (i = 1; i <= 6; i++)
    if (!f[i]) {
      f[i] = 1;
      dfs(x + 1, a + p[i]);
      f[i] = 0;
    }
}
int main() {
  scanf("%s", p + 1);
  dfs(1, s);
  printf("%d\n", yao.size());
  return 0;
}
