Problem: <image>

Recently, a wild Krakozyabra appeared at Jelly Castle. It is, truth to be said, always eager to have something for dinner.

Its favorite meal is natural numbers (typically served with honey sauce), or, to be more precise, the zeros in their corresponding decimal representations. As for other digits, Krakozyabra dislikes them; moreover, they often cause it indigestion! So, as a necessary precaution, Krakozyabra prefers to sort the digits of a number in non-descending order before proceeding to feast. Then, the leading zeros of the resulting number are eaten and the remaining part is discarded as an inedible tail.

For example, if Krakozyabra is to have the number 57040 for dinner, its inedible tail would be the number 457.

Slastyona is not really fond of the idea of Krakozyabra living in her castle. Hovewer, her natural hospitality prevents her from leaving her guest without food. Slastyona has a range of natural numbers from L to R, which she is going to feed the guest with. Help her determine how many distinct inedible tails are going to be discarded by Krakozyabra by the end of the dinner.

Input

In the first and only string, the numbers L and R are given – the boundaries of the range (1 ≤ L ≤ R ≤ 1018).

Output

Output the sole number – the answer for the problem.

Examples

Input

1 10


Output

9


Input

40 57


Output

17


Input

157 165


Output

9

Note

In the first sample case, the inedible tails are the numbers from 1 to 9. Note that 10 and 1 have the same inedible tail – the number 1.

In the second sample case, each number has a unique inedible tail, except for the pair 45, 54. The answer to this sample case is going to be (57 - 40 + 1) - 1 = 17.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
constexpr int MOD = 1000000007;
template <typename T, typename F>
T foo(T t, T g, F f) {
  return t;
}
template <typename T, typename U>
std::istream& operator>>(std::istream& i, pair<T, U>& p) {
  i >> p.first >> p.second;
  return i;
}
template <typename T>
std::istream& operator>>(std::istream& i, vector<T>& t) {
  for (auto& v : t) {
    i >> v;
  }
  return i;
}
template <typename T>
std::ostream& operator<<(std::ostream& o, const vector<T>& t) {
  for (size_t i = 0; i < t.size(); ++i) {
    o << t[i] << " \n"[i == t.size() - 1];
  }
  return o;
}
template <typename T>
using minheap = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using maxheap = priority_queue<T, vector<T>, less<T>>;
auto fraclt = [](const std::pair<int, int>& a, const std::pair<int, int>& b) {
  return (long long)a.first * b.second < (long long)b.first * a.second;
};
struct cmpfrac {
  bool operator()(const std::pair<int, int>& a,
                  const std::pair<int, int>& b) const {
    return (long long)a.first * b.second < (long long)b.first * a.second;
  }
};
template <typename T>
bool in(T a, T b, T c) {
  return a <= b && b < c;
}
int logceil(long long first) {
  int b = 0;
  while (first) {
    first >>= 1;
    ++b;
  }
  return b;
}
namespace std {
template <typename T, typename U>
struct hash<pair<T, U>> {
  hash<T> t;
  hash<U> u;
  size_t operator()(const pair<T, U>& p) const {
    return t(p.first) ^ (u(p.second) << 7);
  }
};
}  // namespace std
template <typename T, typename F>
T bsh(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      l = m + 1;
      r = m;
    } else {
      h = m - 1;
    }
  }
  return r;
}
template <typename T, typename F>
T bsl(T l, T h, const F& f) {
  T r = -1, m;
  while (l <= h) {
    m = (l + h) / 2;
    if (f(m)) {
      h = m - 1;
      r = m;
    } else {
      l = m + 1;
    }
  }
  return r;
}
template <typename T>
T gcd(T a, T b) {
  if (a < b) swap(a, b);
  return b ? gcd(b, a % b) : a;
}
template <typename T>
class vector2 : public vector<vector<T>> {
 public:
  vector2() {}
  vector2(size_t a, size_t b, T t = T())
      : vector<vector<T>>(a, vector<T>(b, t)) {}
};
template <typename T>
class vector3 : public vector<vector<vector<T>>> {
 public:
  vector3() {}
  vector3(size_t a, size_t b, size_t c, T t = T())
      : vector<vector<vector<T>>>(a, vector<vector<T>>(b, vector<T>(c, t))) {}
};
template <typename T>
struct bounded_priority_queue {
  inline bounded_priority_queue(unsigned int X) : A(X), B(0) {}
  inline void push(unsigned int L, T V) {
    B = max(B, L);
    A[L].push(V);
  }
  inline const T& top() const { return A[B].front(); }
  inline void pop() {
    A[B].pop();
    while (B > 0 && A[B].empty()) --B;
  }
  inline bool empty() const { return A[B].empty(); }
  inline void clear() {
    B = 0;
    for (auto& a : A) a = queue<T>();
  }

 private:
  vector<queue<T>> A;
  unsigned int B;
};
constexpr long long toomuch = 1000000000000000000LL;
class TaskC {
 public:
  vector<int> L, R;
  vector<int> DIG, Q, S;
  int ans;
  bool is_below_r(vector<int>& DIG, int i) {
    if (DIG[R[i]] > 0) {
      DIG[R[i]]--;
      for (int j = i + 1; j < 18; ++j) {
        for (int k = 0; k < R[j]; ++k) {
          if (DIG[k] > 0) return true;
        }
        if (DIG[R[j]] == 0) return false;
        DIG[R[j]]--;
      }
      return true;
    }
    return false;
  }
  bool is_within_range() {
    int i = 0;
    while (L[i] == R[i]) {
      if (Q[L[i]] == 0) return false;
      Q[L[i]]--;
      i++;
    }
    for (int j = L[i] + 1; j < R[i]; ++j) {
      if (Q[j]) return true;
    }
    if (Q[L[i]] > 0) {
      S = Q;
      S[L[i]]--;
      for (int j = i + 1; j < 18; ++j) {
        for (int k = L[j] + 1; k < 10; ++k) {
          if (S[k] > 0) return true;
        }
        if (S[L[j]] == 0) return is_below_r(Q, i);
        S[L[j]]--;
      }
      return true;
    }
    return is_below_r(Q, i);
  }
  void gen(int d, int rem) {
    if (d == 9) {
      DIG[9] = rem;
      Q = DIG;
      if (is_within_range()) ++ans;
      return;
    }
    for (int i = 0; i <= rem; ++i) {
      DIG[d] = i;
      gen(d + 1, rem - i);
    }
  }
  void split(long long first, vector<int>& tar) {
    for (int i = 17; i >= 0; --i) {
      tar[i] = first % 10;
      first /= 10;
    }
  }
  void solve(istream& cin, ostream& cout) {
    DIG.resize(10);
    long long a, b;
    cin >> a >> b;
    if (a == b) {
      cout << 1 << endl;
      return;
    }
    if (a == toomuch - 1 && b == toomuch) {
      cout << 2 << endl;
      return;
    }
    bool ismax = b == toomuch;
    if (ismax) --b;
    L.resize(18);
    R.resize(18);
    split(a, L);
    split(b, R);
    ans = 0;
    gen(0, 18);
    if (ismax && a > toomuch / 10) {
      ++ans;
    }
    cout << ans << endl;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  TaskC solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}