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 JAVA):

Solution:
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Arrays;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public long a;
        public long b;
        public int pt;
        public int[] l;
        public int[] r;
        public int[] arr;
        public int ans;

        public void solve(int testNumber, InputReader in, OutputWriter out) {
            a = in.nextLong();
            b = in.nextLong();
            String sa = String.valueOf(a), sb = String.valueOf(b);
            while (sa.length() < sb.length()) sa = "0" + sa;
            l = new int[sa.length()];
            r = new int[sb.length()];
            for (int i = 0; i < sa.length(); i++) l[i] = sa.charAt(i) - '0';
            for (int i = 0; i < sb.length(); i++) r[i] = sb.charAt(i) - '0';
            arr = new int[10];
            long[] pow10 = new long[sb.length() + 1];
            pow10[0] = 1;
            for (int i = 1; i < pow10.length; i++) pow10[i] = pow10[i - 1] * 10;
            pt = 0;
            while (pt < sa.length() && l[pt] == r[pt]) {
                a -= pow10[sb.length() - pt - 1] * l[pt];
                b -= pow10[sb.length() - pt - 1] * l[pt];
                pt++;
            }
            if (pt == sb.length()) {
                out.println(1);
                return;
            }
            dfs(0, r.length - pt);
            out.println(ans);
        }

        public void dfs(int num, int left) {
            if (num == 9) {
                arr[9] = left;
                if (ok(arr)) {
                    ans++;
                }
            } else {
                for (int i = 0; i <= left; i++) {
                    arr[num] = i;
                    dfs(num + 1, left - i);
                }
            }
        }

        public boolean ok(int[] arr) {
            if (arr[r[pt]] > 0) {
                arr[r[pt]] -= 1;
                long g = r[pt];
                for (int dd = 0; dd <= 9; dd++) for (int k = 0; k < arr[dd]; k++) g = g * 10 + dd;
                arr[r[pt]]++;
                if (g <= b) {
                    return true;
                }
            }

            for (int cdig = r[pt] - 1; cdig >= l[pt]; cdig--) {
                if (arr[cdig] > 0) {
                    arr[cdig]--;
                    if (cdig == l[pt]) {
                        long c1 = cdig;
                        for (int dd = 9; dd >= 0; dd--) {
                            for (int k = 0; k < arr[dd]; k++) c1 = c1 * 10 + dd;
                        }
                        if (c1 < a) {
                            arr[cdig]++;
                            if (c1 > b) {
                                System.out.println("BAD!");
                                System.out.println(Arrays.toString(arr) + " " + c1);
                            }
                            return false;
                        }
                    }
                    arr[cdig]++;
                    return true;
                }
            }
            return false;
        }

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (this.numChars == -1) {
                throw new InputMismatchException();
            } else {
                if (this.curChar >= this.numChars) {
                    this.curChar = 0;

                    try {
                        this.numChars = this.stream.read(this.buf);
                    } catch (IOException var2) {
                        throw new InputMismatchException();
                    }

                    if (this.numChars <= 0) {
                        return -1;
                    }
                }

                return this.buf[this.curChar++];
            }
        }

        public long nextLong() {
            int c;
            for (c = this.read(); isSpaceChar(c); c = this.read()) {
                ;
            }

            byte sgn = 1;
            if (c == 45) {
                sgn = -1;
                c = this.read();
            }

            long res = 0L;

            while (c >= 48 && c <= 57) {
                res *= 10L;
                res += (long) (c - 48);
                c = this.read();
                if (isSpaceChar(c)) {
                    return res * (long) sgn;
                }
            }

            throw new InputMismatchException();
        }

        public static boolean isSpaceChar(int c) {
            return c == 32 || c == 10 || c == 13 || c == 9 || c == -1;
        }

    }
}