#include <bits/stdc++.h>
using namespace std;
int perm[6][6] = {{0, 1, 2, 3, 4, 5}, {1, 5, 2, 0, 4, 3}, {2, 5, 3, 0, 1, 4},
                  {3, 5, 4, 0, 2, 1}, {4, 5, 1, 0, 3, 2}, {5, 2, 1, 4, 3, 0}};
set<string> se;
int main() {
  string s;
  cin >> s;
  sort((s).begin(), (s).end());
  do {
    string t = string(6, 'Z');
    for (int top = 0; top < (6); ++top) {
      for (int off = 0; off < (4); ++off) {
        string x;
        x += s[perm[top][0]];
        for (int i = 0; i < (4); ++i) x += s[perm[top][1 + (i + off) % 4]];
        x += s[perm[top][5]];
        if (x < t) t = x;
      }
    }
    se.insert(t);
  } while (next_permutation((s).begin(), (s).end()));
  cout << (int)(se).size() << endl;
  return 0;
}
