#include <bits/stdc++.h>
using namespace std;
long long L, R;
long long X;
int n;
int seq[23] = {0}, tmp[23] = {0};
int A[23] = {0}, B[23] = {0};
bool checkA(int k);
bool checkB(int k);
bool check(int k) {
  if (k == 0) {
    for (int i = A[k]; i <= B[k]; i++)
      if (seq[i] > 0) return true;
    return false;
  }
  bool ok = false;
  if (A[k] == B[k]) {
    if (!seq[A[k]]) return false;
    seq[A[k]]--;
    ok = check(k - 1);
    seq[A[k]]++;
    return ok;
  }
  if (A[k] < B[k]) {
    for (int i = A[k] + 1; i < B[k]; i++)
      if (seq[i] > 0) return true;
    if (seq[A[k]]) {
      seq[A[k]]--;
      ok = checkA(k - 1);
      seq[A[k]]++;
    }
    if (ok) return true;
    if (seq[B[k]]) {
      seq[B[k]]--;
      ok = checkB(k - 1);
      seq[B[k]]++;
    }
  }
  return ok;
}
bool checkA(int k) {
  int l = k;
  for (int i = 9; i >= 0 && l >= 0; i--)
    for (int j = 0; j < seq[i] && l >= 0; j++) {
      tmp[l] = i;
      l--;
    }
  for (int i = k; i > 0; i--)
    if (tmp[i] != A[i]) return tmp[i] > A[i];
  return tmp[0] >= A[0];
}
bool checkB(int k) {
  int l = k;
  for (int i = 0; i <= 9 && l >= 0; i++)
    for (int j = 0; j < seq[i] && l >= 0; j++) {
      tmp[l] = i;
      l--;
    }
  for (int i = k; i > 0; i--)
    if (tmp[i] != B[i]) return tmp[i] < B[i];
  return tmp[0] <= B[0];
}
int dfs(int k, int r) {
  if (r == 0) {
    for (int i = k; i <= 9; i++) seq[i] = 0;
    return check(n - 1);
  }
  int cnt = 0;
  if (k == 9) {
    seq[k] = r;
    return dfs(k + 1, 0);
  }
  for (int i = 0; i <= r; i++) {
    seq[k] = i;
    cnt += dfs(k + 1, r - i);
  }
  return cnt;
}
int digit(long long x, int *dest) {
  if (!x) {
    dest[0] = 0;
    return 1;
  }
  int cnt = 0;
  while (x) {
    dest[cnt] = x % 10;
    x /= 10;
    cnt++;
  }
  return cnt;
}
int main() {
  scanf("%lld%lld", &L, &R);
  digit(L, A);
  n = digit(R, B);
  printf("%d\n", dfs(0, n));
  return 0;
}
