#include <bits/stdc++.h>
using namespace std;
string s;
string str[] = {"012345", "041235", "034125", "023415", "104523", "120453",
                "152043", "145203", "215304", "201534", "230154", "253014"};
bool solve(string x, string y) {
  for (int i = 0; i < 12; i++) {
    string t1;
    for (int j = 0; j < 6; j++) {
      t1 += x[str[i][j] - '0'];
    }
    if (t1 == y) return true;
    string rev = str[i];
    reverse(rev.begin(), rev.end());
    string t2;
    for (int j = 0; j < 6; j++) {
      t2 += x[rev[j] - '0'];
    }
    if (t2 == y) return true;
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> s;
  sort(s.begin(), s.end());
  vector<string> v;
  do {
    bool flag = false;
    for (int i = 0; i < v.size(); i++) {
      if (solve(s, v[i])) {
        flag = true;
      }
    }
    if (!flag) v.push_back(s);
  } while (next_permutation(s.begin(), s.end()));
  cout << v.size() << endl;
  return 0;
}
