#include <bits/stdc++.h>
using namespace std;
const int B = 20;
int R[B], L[B], len;
int tab[10], num[10];
int ans = 0;
inline bool check(int x, bool lb, bool rb) {
  if (x == -1) return 1;
  int l = (lb ? L[x] : 0);
  int r = (rb ? R[x] : 9);
  for (int i = l; i <= r; i++)
    if (num[i]) {
      num[i]--;
      if (check(x - 1, (lb && i == l), (rb && i == r))) return 1;
      num[i]++;
    }
  return 0;
}
inline void solve(int zero) {
  memcpy(num, tab, sizeof(num));
  num[0] = zero;
  if (check(len, 1, 1)) ans++;
}
inline void dfs(int now, int tot) {
  if (now == 10) {
    solve(tot);
    return;
  }
  for (int i = 0; i <= tot; i++) {
    tab[now] = i;
    dfs(now + 1, tot - i);
  }
}
int main() {
  long long l, r;
  scanf("%lld%lld", &l, &r);
  int tmp = -1;
  while (r) {
    R[++tmp] = r % 10;
    r /= 10;
  }
  len = tmp;
  tmp = -1;
  while (l) {
    L[++tmp] = l % 10;
    l /= 10;
  }
  dfs(1, len + 1);
  printf("%d\n", ans);
  return 0;
}
