#include <bits/stdc++.h>
using namespace std;
char s[10];
map<string, int> mc;
void rotate(string s, int c) {
  if (mc.find(s) != mc.end()) return;
  mc[s] = c;
  string n = s;
  n[0] = s[1];
  n[1] = s[2];
  n[2] = s[3];
  n[3] = s[0];
  rotate(n, c);
  n = s;
  n[1] = s[5];
  n[5] = s[3];
  n[3] = s[4];
  n[4] = s[1];
  rotate(n, c);
}
int main(int argc, char* argv[]) {
  scanf("%s", &s);
  sort(s, s + 6);
  int c = 0;
  do {
    if (mc.find(s) == mc.end()) {
      rotate(string(s), c);
      c++;
    }
  } while (next_permutation(s, s + 6));
  cout << c;
  return 0;
}
