#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > forms;
int generate() {
  {
    int a[] = {0, 1, 2, 3, 4, 5};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  {
    int a[] = {4, 1, 5, 3, 2, 0};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  {
    int a[] = {2, 1, 0, 3, 5, 4};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  {
    int a[] = {5, 1, 4, 3, 0, 2};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  {
    int a[] = {0, 5, 2, 4, 1, 3};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  {
    int a[] = {0, 4, 2, 5, 3, 1};
    for (int k = 0; k < 4; k++) {
      vector<int> v;
      for (int i = 0; i < 6; i++) v.push_back(a[i]);
      forms.push_back(v);
      int t = a[0];
      for (int i = 0; i < 3; i++) a[i] = a[i + 1];
      a[3] = t;
    }
  }
  return 0;
}
string trans(string &s, vector<int> &f) {
  string d(s.begin(), s.end());
  for (int i = 0; i < f.size(); i++) d[i] = s[f[i]];
  return d;
}
bool equal(string &a, string &b) {
  for (int i = 0; i < forms.size(); i++) {
    string c = trans(b, forms[i]);
    if (a == c) return true;
  }
  return false;
}
int main() {
  generate();
  string line;
  cin >> line;
  sort(line.begin(), line.end());
  set<string> S;
  int ans = 0;
  do {
    if (S.find(line) == S.end()) {
      ans++;
      for (int i = 0; i < forms.size(); i++) {
        string t = trans(line, forms[i]);
        S.insert(t);
      }
    }
  } while (next_permutation(line.begin(), line.end()));
  cout << ans << endl;
  return 0;
}
