#include <bits/stdc++.h>
using namespace std;
long long A, B;
int a[20], b[20], num, ans, c[10];
int dfs(int pos, int l, int r) {
  if (pos < 1) return 1;
  if (!l && !r) return 1;
  int L = l ? a[pos] : 0;
  int R = r ? b[pos] : 9;
  for (int i = L; i <= R; i++) {
    int flag = 0;
    if (c[i]) {
      c[i]--;
      flag = dfs(pos - 1, l && i == L, r && i == R);
      c[i]++;
    }
    if (flag) return 1;
  }
}
void solve(int nu, int k) {
  if (k == 9) {
    c[k] = nu;
    ans += dfs(num, 1, 1);
    return;
  }
  for (int i = 0; i <= nu; i++) {
    c[k] = i;
    solve(nu - i, k + 1);
  }
}
int main() {
  while (~scanf("%lld%lld", &A, &B)) {
    num = ans = 0;
    while (B > 0) {
      num++;
      a[num] = A % 10;
      b[num] = B % 10;
      A /= 10;
      B /= 10;
    }
    memset(c, 0, sizeof c);
    solve(num, 0);
    printf("%d\n", ans);
  }
  return 0;
}
