#include <bits/stdc++.h>
using namespace std;
char s[10], st[1000][10];
void xx() {
  char ans[10];
  for (int i = 0; i < 4; i++) ans[(i + 1) % 4] = s[i];
  ans[4] = s[4];
  ans[5] = s[5];
  for (int i = 0; i < 6; i++) s[i] = ans[i];
}
void yy() {
  char ans[10];
  ans[0] = s[0];
  ans[1] = s[5];
  ans[2] = s[2];
  ans[3] = s[4];
  ans[4] = s[1];
  ans[5] = s[3];
  for (int i = 0; i < 6; i++) s[i] = ans[i];
}
void zz() {
  char ans[10];
  ans[0] = s[4];
  ans[1] = s[1];
  ans[2] = s[5];
  ans[3] = s[3];
  ans[4] = s[2];
  ans[5] = s[0];
  for (int i = 0; i < 6; i++) s[i] = ans[i];
}
bool same(char st[]) {
  for (int k = 0; k < 4; k++) {
    xx();
    for (int j = 0; j < 4; j++) {
      yy();
      for (int l = 0; l < 4; l++) {
        zz();
        bool flag = true;
        for (int i = 0; i < 6 && flag; i++) {
          if (s[i] != st[i]) flag = false;
        }
        if (flag) return true;
      }
    }
  }
  return false;
}
int main() {
  cin >> s;
  sort(s, s + 6);
  int ans = 0;
  do {
    char tmp[10];
    for (int i = 0; i < 6; i++) tmp[i] = s[i];
    int flag = 1;
    for (int i = 0; i < ans && flag; i++)
      if (same(st[i])) flag = 0;
    if (flag) {
      for (int i = 0; i < 6; i++) st[ans][i] = tmp[i];
      ans++;
    }
    for (int i = 0; i < 6; i++) s[i] = tmp[i];
  } while (next_permutation(s, s + 6));
  printf("%d\n", ans);
  return 0;
}
