#include <bits/stdc++.h>
using std::array;
using std::bitset;
using std::cin;
using std::cout;
using std::deque;
using std::endl;
using std::function;
using std::ios_base;
using std::list;
using std::map;
using std::max;
using std::min;
using std::multiset;
using std::next_permutation;
using std::pair;
using std::priority_queue;
using std::queue;
using std::set;
using std::stack;
using std::string;
using std::swap;
using std::unordered_map;
using std::unordered_set;
using std::vector;
string front(string s) {
  string t;
  t += s[3], t += s[0], t += s[1], t += s[2], t += s[4], t += s[5];
  return t;
}
string left(string s) {
  string t;
  t += s[0], t += s[5], t += s[2], t += s[4], t += s[1], t += s[3];
  return t;
}
string getmin(string s) {
  string mn = s;
  for (int i = 0; i < 7; i++) {
    for (int m = 0; m < (1 << i); m++) {
      string t = s;
      for (int b = 0; b < i; b++) {
        if (1 << b & m) {
          t = front(t);
        } else {
          t = left(t);
        }
      }
      mn = min(mn, t);
    }
  }
  return mn;
}
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  string s;
  cin >> s;
  sort(s.begin(), s.end());
  set<string> a;
  do {
    a.insert(getmin(s));
  } while (next_permutation(s.begin(), s.end()));
  cout << a.size();
  exit(EXIT_SUCCESS);
}
