#include <bits/stdc++.h>
using namespace std;
string l, r;
int res, a[10], b[10], s;
bool check1() {
  int mark = 0;
  for (int i = 0; i < 10; ++i) a[i] = b[i];
  for (int i = 0; i < 19; ++i) {
    if (!mark) {
      for (int j = l[i] - '0' + 1; j < r[i] - '0'; ++j)
        if (a[j]) return 1;
      if (a[l[i] - '0']) {
        --a[l[i] - '0'];
        if (l[i] != r[i]) mark = -1;
      } else if (a[r[i] - '0']) {
        --a[r[i] - '0'];
        if (l[i] != r[i]) mark = 1;
      } else
        return 0;
    } else if (mark == -1) {
      for (int j = l[i] - '0' + 1; j < 10; ++j)
        if (a[j]) return 1;
      if (!a[l[i] - '0']) return 0;
      --a[l[i] - '0'];
    } else {
      for (int j = r[i] - '0' - 1; j >= 0; --j)
        if (a[j]) return 1;
      if (!a[r[i] - '0']) return 0;
      --a[r[i] - '0'];
    }
  }
  return 1;
}
bool check2() {
  int mark = 0;
  for (int i = 0; i < 10; ++i) a[i] = b[i];
  for (int i = 0; i < 19; ++i) {
    if (!mark) {
      for (int j = l[i] - '0' + 1; j < r[i] - '0'; ++j)
        if (a[j]) return 1;
      if (a[r[i] - '0']) {
        --a[r[i] - '0'];
        if (l[i] != r[i]) mark = 1;
      } else if (a[l[i] - '0']) {
        --a[l[i] - '0'];
        if (l[i] != r[i]) mark = -1;
      } else
        return 0;
    } else if (mark == -1) {
      for (int j = l[i] - '0' + 1; j < 10; ++j)
        if (a[j]) return 1;
      if (!a[l[i] - '0']) return 0;
      --a[l[i] - '0'];
    } else {
      for (int j = r[i] - '0' - 1; j >= 0; --j)
        if (a[j]) return 1;
      if (!a[r[i] - '0']) return 0;
      --a[r[i] - '0'];
    }
  }
  return 1;
}
int cnt = 0;
void duyet(int i) {
  if (i == 9) {
    b[i] = 19 - s;
    if (check1() || check2()) ++res;
    return;
  }
  for (int j = 0; j < 19; ++j)
    if (s + j <= 19) {
      b[i] = j;
      s += j;
      duyet(i + 1);
      s -= j;
    }
}
int main() {
  cin >> l >> r;
  reverse(l.begin(), l.end());
  reverse(r.begin(), r.end());
  while (l.size() < 19) l.push_back('0');
  while (r.size() < 19) r.push_back('0');
  reverse(l.begin(), l.end());
  reverse(r.begin(), r.end());
  duyet(0);
  printf("%d\n", res);
}
