#include <bits/stdc++.h>
using namespace std;
int a[][6] = {{1, 2, 3, 4, 0, 5}, {0, 4, 5, 2, 1, 3}, {0, 1, 5, 3, 2, 4},
              {4, 3, 2, 1, 5, 0}, {2, 5, 4, 0, 3, 1}, {3, 5, 1, 0, 4, 2}};
string gao(string s) {
  string ans = "ZZZZZZ", tmp = "ZZZZZZ";
  for (int i = 0; i < 6; i++) {
    for (int j = 0; j < 6; j++) tmp[j] = s[a[i][j]];
    for (int p = 0; p < 4; p++) {
      for (int q = 0; q < 3; q++) swap(tmp[q], tmp[q + 1]);
      ans = min(ans, tmp);
    }
  }
  return ans;
}
int main() {
  string s;
  while (cin >> s) {
    set<string> st;
    sort(s.begin(), s.end());
    do {
      st.insert(gao(s));
    } while (next_permutation(s.begin(), s.end()));
    cout << st.size() << endl;
  }
}
