#include <bits/stdc++.h>
using namespace std;
int a[20], b[20], pos, num[10], ans;
bool check(int cur, bool Lflag, bool Rflag) {
  if ((!Lflag && !Rflag) || cur == -1) return true;
  int up = Rflag ? b[cur] : 9;
  int down = Lflag ? a[cur] : 0;
  if (up < down) return false;
  for (int i = down; i <= up; i++) {
    if (num[i] > 0) {
      num[i]--;
      bool res = check(cur - 1, Lflag && i == a[cur], Rflag && i == b[cur]);
      num[i]++;
      if (res) return true;
    }
  }
  return false;
}
void dfs(int cur, int now) {
  if (cur == 9) {
    num[9] = now;
    if (check(pos - 1, true, true)) ans++;
  } else {
    for (int i = 0; i <= now; i++) {
      num[cur] = i;
      dfs(cur + 1, now - i);
    }
  }
}
int main() {
  long long L, R;
  scanf("%lld%lld", &L, &R);
  while (L > 0) {
    a[pos++] = L % 10;
    L /= 10;
  }
  pos = 0;
  while (R > 0) {
    b[pos++] = R % 10;
    R /= 10;
  }
  dfs(0, pos);
  printf("%d\n", ans);
  return 0;
}
