#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - 48, c = getchar();
  return x;
}
int pos, ans;
int a[20], b[20];
int cnt[10];
bool is(int pos, bool Lbound, bool Rbound) {
  if (pos == 0) return true;
  if (!Lbound && !Rbound) return true;
  int l = Lbound ? a[pos] : 0;
  int r = Rbound ? b[pos] : 9;
  for (int i = l; i <= r; i++) {
    if (cnt[i]) {
      cnt[i]--;
      if (is(pos - 1, Lbound && i == l, Rbound && i == r)) {
        cnt[i]++;
        return true;
      }
      cnt[i]++;
    }
  }
  return false;
}
void dfs(int cur, int total) {
  if (cur == 9) {
    cnt[cur] = total;
    ans += is(pos, 1, 1);
    return;
  }
  for (int i = 0; i <= total; i++) {
    cnt[cur] = i;
    dfs(cur + 1, total - i);
  }
}
int digit(int *d, long long x) {
  int pos = 0;
  while (x) {
    d[++pos] = x % 10;
    x /= 10;
  }
  return pos;
}
int main() {
  long long L, R;
  cin >> L >> R;
  pos = digit(a, L);
  pos = digit(b, R);
  ans = 0;
  dfs(0, pos);
  cout << ans << endl;
  return 0;
}
