#include <bits/stdc++.h>
using namespace std;
template <class T>
void rd(T &x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  x *= f;
}
const int N = 20;
int a[N], b[N], cnt[N], tot;
long long ans, x;
void split(int *a) {
  tot = 0;
  while (x) {
    a[++tot] = x % 10;
    x /= 10;
  }
  return;
}
bool query(int x, int l, int r) {
  if (x == 0 || l + r == 0) return 1;
  int L = l ? a[x] : 0, R = r ? b[x] : 9;
  for (int i = L; i <= R; i++)
    if (cnt[i]) {
      cnt[i]--;
      if (query(x - 1, l & (i == L), r & (i == R))) {
        cnt[i]++;
        return 1;
      }
      cnt[i]++;
    }
  return 0;
}
void dfs(int now, int s) {
  if (now == 9) {
    cnt[now] = s;
    ans += query(tot, 1, 1);
    return;
  }
  for (int i = 0; i <= s; i++) {
    cnt[now] = i;
    dfs(now + 1, s - i);
  }
}
int main() {
  rd(x);
  split(a);
  rd(x);
  split(b);
  dfs(0, tot);
  printf("%lld", ans);
  return 0;
}
