#include <bits/stdc++.h>
using namespace std;
int perm[6];
set<string> res;
char S[10];
void rot(string& s, int a, int b, int c, int d) {
  char tmp = s[a];
  s[a] = s[b];
  s[b] = s[c];
  s[c] = s[d];
  s[d] = tmp;
}
void rotR(string& s) { rot(s, 1, 2, 3, 4); }
void rotU(string& s) { rot(s, 5, 2, 0, 4); }
bool ex(string s) { return res.count(s) > 0; }
int main() {
  scanf("%s", S);
  for (int i = 0; i < 6; i++) {
    perm[i] = i;
  }
  do {
    string s = "";
    for (int i = 0; i < 6; i++) {
      s += S[perm[i]];
    }
    bool good = true;
    for (int i = 0; i < 4; i++) {
      rotR(s);
      for (int j = 0; j < 4; j++) {
        rotU(s);
        if (ex(s)) {
          good = false;
        }
      }
    }
    rotU(s);
    rotR(s);
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 4; j++) {
        rotU(s);
        if (ex(s)) {
          good = false;
        }
      }
      rotR(s);
      rotR(s);
    }
    if (good) {
      res.insert(s);
    }
  } while (next_permutation(perm, perm + 6));
  printf("%d\n", res.size());
  return 0;
}
