#include <bits/stdc++.h>
using namespace std;
const int nMAX = 20;
long long comb[nMAX][nMAX];
long long mem[10][20];
int cnt[10];
long long nCr(int n, int k) {
  if (n < k) return 0;
  if (k == 0 || n == 0) return 1;
  if (~comb[n][k]) return comb[n][k];
  if (n - k < k) return comb[n][k] = nCr(n, n - k);
  return comb[n][k] = nCr(n - 1, k - 1) + nCr(n - 1, k);
}
long long dp(int digit, int mad) {
  if (digit == 10) return 1;
  long long &ret = mem[digit][mad];
  ret = 0;
  if (!cnt[digit]) ret = dp(digit + 1, mad);
  for (int takenSoFar = 1; takenSoFar < (int)cnt[digit] + 1; ++takenSoFar)
    ret +=
        nCr(digit == 9 ? takenSoFar + mad - 1 : takenSoFar + mad, takenSoFar) *
        dp(digit + 1, mad + takenSoFar);
  return ret;
}
string s;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  memset(mem, -1, sizeof mem);
  memset(comb, -1, sizeof comb);
  cin >> s;
  for (int i = 0; i < (int)(int)s.size(); ++i) cnt[s[i] - '0']++;
  reverse(cnt, cnt + 10);
  cout << dp(0, 0) << "\n";
}
