#include <bits/stdc++.h>
using namespace std;
set<string> a;
void rotateX(string &t) {
  char c = t[2];
  t[2] = t[3];
  t[3] = t[4];
  t[4] = t[5];
  t[5] = c;
}
void rotateY(string &t) {
  char c = t[0];
  t[0] = t[2];
  t[2] = t[1];
  t[1] = t[4];
  t[4] = c;
}
void rotateZ(string &t) {
  char c = t[0];
  t[0] = t[3];
  t[3] = t[1];
  t[1] = t[5];
  t[5] = c;
}
int main(int argc, char **argv) {
  if (argc > 1) freopen(argv[1], "r", stdin);
  string s;
  cin >> s;
  int b[6] = {0, 1, 2, 3, 4, 5};
  int r = 0;
  do {
    string t;
    for (int i = 0; i < (6); ++i) t += s[b[i]];
    if (a.find(t) == a.end()) ++r;
    for (int x = 0; x < (4); ++x) {
      for (int y = 0; y < (4); ++y) {
        for (int z = 0; z < (4); ++z) {
          if (a.find(t) == a.end()) a.insert(t);
          rotateZ(t);
        }
        rotateX(t);
      }
      rotateY(t);
    }
  } while (next_permutation(b, b + 6));
  cout << r << endl;
  return 0;
}
