#include <bits/stdc++.h>
using namespace std;
vector<vector<int>> v;
string s;
set<vector<int>> mp;
vector<int> rot = {0, 4, 2, 5, 3, 1};
vector<int> hor(vector<int> a) {
  for (int i = 1, ThxDem = 4; i < ThxDem; ++i) swap(a[i], a[i - 1]);
  return a;
}
vector<int> ver(vector<int> a) {
  vector<int> ans;
  for (int i = 0, ThxDem = 6; i < ThxDem; ++i) ans.push_back(a[rot[i]]);
  return ans;
}
void dfs(vector<int> a) {
  if (mp.find(a) != mp.end()) return;
  v.push_back(a);
  mp.insert(a);
  dfs(hor(a));
  dfs(ver(a));
}
set<string> ans;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> s;
  sort(s.begin(), s.end());
  dfs({0, 1, 2, 3, 4, 5});
  do {
    int can = 1;
    for (int i = 0, ThxDem = ((int)(v).size()); i < ThxDem; ++i) {
      string now = "";
      for (int j = 0, ThxDem = 6; j < ThxDem; ++j) now += s[v[i][j]];
      if (ans.find(now) != ans.end()) {
        can = 0;
        break;
      }
    }
    if (can) {
      ans.insert(s);
    }
  } while (next_permutation(s.begin(), s.end()));
  cout << ans.size() << endl;
}
