#include <bits/stdc++.h>
using namespace std;
const int INF = 0X3F3F3F3F;
const double PI = acos(-1.0);
const double EPS = 1e-9;
const int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int dx[] = {-1, 0, 1, 0}, dy[] = {0, 1, 0, -1};
inline int sgn(double x) { return x < -EPS ? -1 : x > EPS ? 1 : 0; }
template <class T>
inline T sqr(const T& x) {
  return x * x;
}
template <class T>
inline int toint(const T& x) {
  stringstream ss;
  ss << x;
  int r;
  ss >> r;
  return r;
}
template <class T>
inline int todouble(const T& x) {
  stringstream ss;
  ss << x;
  double r;
  ss >> r;
  return r;
}
template <class T>
inline string tostr(const T& x) {
  ostringstream os("");
  os << x;
  return os.str();
}
template <class T>
inline istream& operator<<(istream& is, const T& a) {
  is.putback(a);
  return is;
}
inline string tolower(string s) {
  for (int i = 0; i < (int)(s.size()); ++i) s[i] = tolower(s[i]);
  return s;
}
inline string toupper(string s) {
  for (int i = 0; i < (int)(s.size()); ++i) s[i] = toupper(s[i]);
  return s;
}
template <class T>
void stov(string s, vector<T>& vi) {
  vi.clear();
  istringstream sin(s);
  for (T v; sin >> v; vi.push_bakc(v))
    ;
}
template <class T>
void vtos(vector<T> vi, string& s) {
  ostringstream sout;
  for (int i = 0; i < vi.size(); i++) {
    if (i > 0) sout << ' ';
    sout << vi[i];
  }
  s = sout.str();
}
template <class T>
inline T gcd(T a, T b) {
  if (a < 0) return gcd(-a, b);
  if (b < 0) return gcd(a, -b);
  return (b == 0) ? a : gcd(b, a % b);
}
template <class T>
inline T lcm(T a, T b) {
  if (a < 0) return lcm(-a, b);
  if (b < 0) return lcm(a, -b);
  return a * (b / gcd(a, b));
}
template <class T>
inline vector<pair<T, int> > factorize(T n) {
  vector<pair<T, int> > R;
  for (T i = 2; n > 1;) {
    if (n % i == 0) {
      int C = 0;
      for (; n % i == 0; C++, n /= i)
        ;
      R.push_back(make_pair(i, C));
    }
    i++;
    if (i > n / i) i = n;
  }
  if (n > 1) R.push_back(make_pair(n, 1));
  return R;
}
template <class T>
inline bool isprime(T n) {
  if (n < 2) return false;
  for (T i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
template <class T>
inline T phi(T n) {
  vector<pair<T, int> > R = factorize(n);
  T r = n;
  for (int i = 0; i < R.size(); i++) r = r / R[i].first * (R[i].first - 1);
  return r;
}
vector<int> v;
bool used[26];
map<char, int> mp;
char what[6];
int aa[24][6] = {
    {1, 2, 3, 4, 5, 6}, {1, 3, 4, 5, 2, 6}, {1, 4, 5, 2, 3, 6},
    {1, 5, 2, 3, 4, 6}, {4, 1, 3, 6, 5, 2}, {4, 3, 6, 5, 1, 2},
    {4, 6, 5, 1, 3, 2}, {4, 5, 1, 3, 6, 2}, {5, 2, 1, 4, 6, 3},
    {5, 1, 4, 6, 2, 3}, {5, 4, 6, 2, 1, 3}, {5, 6, 2, 1, 4, 3},
    {2, 6, 3, 1, 5, 4}, {2, 3, 1, 5, 6, 4}, {2, 1, 5, 6, 3, 4},
    {2, 5, 6, 3, 1, 4}, {3, 2, 6, 4, 1, 5}, {3, 6, 4, 1, 2, 5},
    {3, 4, 1, 2, 6, 5}, {3, 1, 2, 6, 4, 5}, {6, 2, 5, 4, 3, 1},
    {6, 5, 4, 3, 2, 1}, {6, 4, 3, 2, 5, 1}, {6, 3, 2, 5, 4, 1},
};
vector<string> str, ans;
bool check(int a, int b) {
  for (int i = 0; i < 24; i++) {
    bool flag = 1;
    for (int j = 0; j < 6; j++) {
      if (str[a][j] != str[b][aa[i][j] - 1]) {
        flag = 0;
      }
    }
    if (flag) return 0;
  }
  return 1;
}
bool ok[1111];
int main() {
  int n = 6;
  string s;
  getline(cin, s);
  long long cnt = 0;
  for (int i = 0; i < n; i++) {
    if (!mp.count(s[i])) {
      what[cnt++] = s[i];
    }
    mp[s[i]]++;
  }
  sort(s.begin(), s.end());
  do {
    str.push_back(s);
  } while (next_permutation(s.begin(), s.end()));
  for (int i = 0; i < str.size(); i++) {
    if (!ok[i]) {
      ans.push_back(str[i]);
    }
    bool flag = 1;
    for (int j = i + 1; j < str.size(); j++) {
      if (!check(i, j)) {
        ok[j] = 1;
        break;
      }
    }
  }
  cout << ans.size() << endl;
}
