#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e14 + 9;
string faces;
void rotateX() {
  char aux = faces[2];
  faces[2] = faces[1];
  faces[1] = faces[5];
  faces[5] = faces[3];
  faces[3] = aux;
}
void rotateY() {
  char aux = faces[4];
  faces[4] = faces[5];
  faces[5] = faces[0];
  faces[0] = faces[2];
  faces[2] = aux;
}
void rotateZ() {
  char aux = faces[3];
  faces[3] = faces[0];
  faces[0] = faces[1];
  faces[1] = faces[4];
  faces[4] = aux;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  sort(begin(s), end(s));
  set<string> perms;
  long long ans = 0;
  do {
    faces = "";
    for (long long i = 0; i < ((long long)(s).size()); ++i) {
      faces += s[i];
    }
    if (perms.find(faces) == perms.end()) {
      ans++;
      for (long long i = 0; i < (4); ++i) {
        for (long long j = 0; j < (4); ++j) {
          for (long long k = 0; k < (4); ++k) {
            perms.insert(faces);
            rotateZ();
          }
          rotateY();
        }
        rotateX();
      }
    }
  } while (next_permutation(begin(s), end(s)));
  cout << ans << '\n';
  return 0;
}
