#include <bits/stdc++.h>
using namespace std;
const int n = 6;
set<string> M;
void move(char &a, char &b, char &c, char &d) {
  int t = d;
  d = c;
  c = b;
  b = a;
  a = t;
}
int main() {
  char str[10], a[10];
  scanf("%s", str);
  int ans = 0;
  M.clear();
  for (int i = 0; i < 720; i++) {
    if (M.find(str) == M.end()) {
      ans++;
    }
    strcpy(a, str);
    for (int j = 0; j < 4; j++) {
      move(a[0], a[1], a[2], a[3]);
      for (int k = 0; k < 4; k++) {
        move(a[0], a[5], a[2], a[4]);
        for (int p = 0; p < 4; p++) {
          move(a[1], a[5], a[3], a[4]);
          M.insert(a);
        }
      }
    }
    next_permutation(str, str + 6);
  }
  printf("%d\n", ans);
}
