#include <bits/stdc++.h>
using namespace std;
const long long Mod = 1000000007LL;
const int N = 2e5 + 10;
const long long Inf = 2242545357980376863LL;
const long long Log = 30;
map<string, long long> mp;
vector<pair<long long, long long> > V;
vector<long long> G[N];
vector<string> A;
long long mk[N];
void DFS(long long u) {
  mk[u] = 1;
  for (auto adj : G[u]) {
    if (!mk[adj]) DFS(adj);
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  for (int i = 0; i < 6; i++) V.push_back({i + 1, s[i]});
  long long cnt = 0;
  do {
    string t = "";
    for (auto x : V) t += x.second;
    if (mp[t] == 0) {
      mp[t] = cnt + 1;
      cnt++;
      A.push_back(t);
    }
  } while (next_permutation(V.begin(), V.end()));
  string nx;
  for (auto y : A) {
    nx = y;
    swap(nx[0], nx[2]);
    swap(nx[2], nx[1]);
    swap(nx[1], nx[3]);
    G[mp[y]].push_back(mp[nx]);
    G[mp[nx]].push_back(mp[y]);
    nx = y;
    swap(nx[0], nx[4]);
    swap(nx[4], nx[1]);
    swap(nx[1], nx[5]);
    G[mp[y]].push_back(mp[nx]);
    G[mp[nx]].push_back(mp[y]);
    nx = y;
    swap(nx[3], nx[4]);
    swap(nx[4], nx[2]);
    swap(nx[2], nx[5]);
    G[mp[y]].push_back(mp[nx]);
    G[mp[nx]].push_back(mp[y]);
  }
  long long ans = 0;
  for (int i = 1; i <= cnt; i++)
    if (!mk[i]) {
      DFS(i);
      ans++;
    }
  cout << ans << '\n';
  return 0;
}
