#include <bits/stdc++.h>
using namespace std;
enum STATE { IN, OUT, BOUNDRY };
const long long MOD = 1000000007;
const int INF = 2000 * 1000 * 1000 + 5;
const int MAX = 1005;
int popcount(int n) {
  bitset<32> b(n);
  return b.count();
}
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) {
  long long temp = gcd(a, b);
  return temp ? (a / temp * b) : 0;
}
template <typename T>
T modpow(T base, T exp, T modulus) {
  base %= modulus;
  T result = 1;
  while (exp > 0) {
    if (exp & 1) result = (result * base) % modulus;
    base = (base * base) % modulus;
    exp >>= 1;
  }
  return result;
}
inline bool isInteger(const std::string& s) {
  if (s.empty() || ((!isdigit(s[0])) && (s[0] != '-') && (s[0] != '+')))
    return false;
  char* p;
  strtol(s.c_str(), &p, 10);
  return (*p == 0);
}
int op[] = {1, 0, 4, 5, 2, 3};
int main() {
  vector<string> v;
  string s;
  cin >> s;
  sort((s).begin(), (s).end());
  do {
    bool ok = 1;
    for (int i = 0; i < 6; i++) {
      string cur = s;
      if (i == 1) {
        swap(cur[0], cur[1]);
        swap(cur[2], cur[4]);
      } else if (i) {
        swap(cur[0], cur[i]);
        swap(cur[1], cur[op[i]]);
        swap(cur[i], cur[op[i]]);
      }
      for (int j = 0; j < 4; j++) {
        for (int k = 0; k < v.size(); k++) {
          if (cur == v[k]) {
            ok = 0;
            break;
          }
        }
        if (!ok) break;
        rotate(cur.begin() + 2, cur.begin() + 3, cur.end());
      }
      if (!ok) break;
    }
    if (ok) v.push_back(s);
  } while (next_permutation((s).begin(), (s).end()));
  cout << v.size() << endl;
  return 0;
}
