#include <bits/stdc++.h>
using namespace std;
int a[101];
int b[101];
int pos = 0;
int ans = 0;
int c[101];
int ck(int pos, int l, int r) {
  if (!l && !r) return 1;
  if (pos == -1) return 1;
  int rl = r ? b[pos] : 9;
  int ll = l ? a[pos] : 0;
  ;
  for (int i = ll; i <= rl; i++) {
    int f = 0;
    if (c[i]) {
      c[i]--;
      if (ck(pos - 1, l && i == a[pos], r && i == b[pos])) f = 1;
      c[i]++;
      if (f == 1) return 1;
    }
  }
  return 0;
}
void dfs(int k, int tot) {
  if (k == 9) {
    c[k] = tot;
    if (ck(pos - 1, 1, 1)) ans++;
    return;
  }
  for (int i = 0; i <= tot; i++) {
    c[k] = i;
    dfs(k + 1, tot - i);
  }
}
int main() {
  long long l, r;
  scanf("%I64d%I64d", &l, &r);
  while (l) {
    a[pos] = l % 10;
    l /= 10;
    pos++;
  }
  pos = 0;
  while (r) {
    b[pos] = r % 10;
    r /= 10;
    pos++;
  }
  dfs(0, pos);
  printf("%d\n", ans);
  return 0;
}
