#include <bits/stdc++.h>
using namespace std;
long long a, b;
int xx[1000000], yy[1000000], n, m, ans, bo[100000];
int check(int p, int x, int y) {
  if ((!p) || (!(x + y))) return 1;
  int l, r;
  if (x)
    l = xx[p];
  else
    l = 0;
  if (y)
    r = yy[p];
  else
    r = 9;
  for (int i = l; i <= r; i++)
    if (bo[i]) {
      --bo[i];
      if (check(p - 1, x & (i == l), y & (i == r))) {
        ++bo[i];
        return 1;
      }
      ++bo[i];
    }
  return 0;
}
void dfs(int x, int y) {
  if (x == 9) {
    bo[9] = y;
    ans += check(m, 1, 1);
    return;
  }
  for (int i = 0; i <= y; i++) {
    bo[x] = i;
    dfs(x + 1, y - i);
  }
}
int main() {
  scanf("%lld%lld", &a, &b);
  for (n = 1; a; n++, a /= 10) xx[n] = a % 10;
  --n;
  for (m = 1; b; m++, b /= 10) yy[m] = b % 10;
  --m;
  dfs(0, m);
  printf("%d", ans);
}
