#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
const int mod = 1e9 + 7;
const long long INF = 1e18;
const long long MAX = 1e5 + 10, N = 1e6 + 10;
const int lim = 1 << 18;
vector<string> rot(string s) {
  vector<string> ret;
  for (int i = 0; i < 4; i++) {
    rotate(s.begin() + 1, s.begin() + 2, s.begin() + 5);
    string x = s;
    for (int j = 0; j < 4; j++) {
      char tmp = s[5];
      s[5] = s[2], s[2] = s[0], s[0] = s[4], s[4] = tmp;
      ret.push_back(s);
    }
  }
  return ret;
}
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  while (cin >> s) {
    vector<string> v;
    sort(s.begin(), s.end());
    int cnt = 0;
    do {
      bool ad = true;
      vector<string> tmp = rot(s);
      if (v.size()) {
        for (int i = 0; i < v.size() && ad; i++) {
          for (int j = 0; j < tmp.size() && ad; j++) {
            if (tmp[j] == v[i]) ad = false;
          }
        }
      }
      if (ad) {
        cnt++;
        v.insert(v.end(), tmp.begin(), tmp.end());
      }
    } while (next_permutation(s.begin(), s.end()));
    cout << cnt << "\n";
  }
  return 0;
}
