#include <bits/stdc++.h>
using namespace std;
long long l, r;
vector<int> currv;
vector<int> ldigs;
vector<int> rdigs;
int ans = 0;
int digsL = 0;
int digsR = 0;
int globcnt[10];
void printv(vector<int> vr) {
  for (int i = 0; i < ((vr).size()); i++) cout << vr[i];
  cout << endl;
}
int cnts[10];
int cpy[10];
void check(int used) {
  if (used == 0) return;
  if (used > digsR) return;
  memcpy(cnts, globcnt, sizeof(cnts));
  int jjj = 1;
  for (int i = 0; i <= rdigs.size(); i++) {
    if (i != 0) {
      if (cnts[rdigs[i - 1]] > 0) {
        cnts[rdigs[i - 1]]--;
      } else {
        return;
      }
    }
    long long build_num = 0;
    int nonzeros = 0;
    for (int j = 0; j < (i); j++) {
      if (rdigs[j] != 0) nonzeros++;
      build_num = 10 * build_num + rdigs[j];
    }
    if (i == rdigs.size() && nonzeros == used && build_num == r) {
      ans++;
      return;
    }
    if (i == rdigs.size()) return;
    memcpy(cpy, cnts, sizeof(cpy));
    bool fnd = false;
    for (int fv = rdigs[i] - 1; fv >= 0; fv--) {
      if (cpy[fv] > 0) {
        cpy[fv]--;
        build_num = 10 * build_num + fv;
        if (fv != 0) nonzeros++;
        fnd = true;
        break;
      }
    }
    if (!fnd) continue;
    int posleft = rdigs.size() - 1 - (i + 1) + 1;
    int jjnum = 9;
    while (posleft > 0 && jjnum >= 0) {
      if (cpy[jjnum] == 0) {
        jjnum--;
      } else {
        cpy[jjnum]--;
        build_num = 10 * build_num + jjnum;
        if (jjnum != 0) nonzeros++;
        posleft--;
      }
    }
    if (nonzeros == used) {
      bool bad = false;
      if (build_num >= l) {
        ans++;
        return;
      }
    }
    jjj = (jjj + i);
  }
}
void build(int i, int used, bool added_smth) {
  if (used <= digsR && used < 19 && added_smth) check(used);
  if (used == digsR) return;
  if (i >= 10) return;
  globcnt[i]++;
  build(i, used + 1, true);
  globcnt[i]--;
  build(i + 1, used, false);
}
int main() {
  cin >> l >> r;
  if (l == r) {
    cout << 1 << endl;
    return 0;
  }
  long long tmpl = l;
  long long tmpr = r;
  while (tmpl > 0) {
    digsL++;
    ldigs.push_back(tmpl % 10);
    tmpl /= 10;
  }
  while (tmpr > 0) {
    digsR++;
    rdigs.push_back(tmpr % 10);
    tmpr /= 10;
  }
  while (ldigs.size() < rdigs.size()) ldigs.push_back(0);
  reverse((ldigs).begin(), (ldigs).end());
  reverse((rdigs).begin(), (rdigs).end());
  globcnt[0] = 18;
  build(1, 0, true);
  cout << ans << endl;
}
