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.lang.*;
import java.math.*;
import java.util.*;
import java.io.*;

public class Main {
    void solve() {
        long MX=(long)1e18;
        long l=nl(),r=nl();
        if(l==MX && r==MX){
            pw.println("1");
            return;
        }
        long rr=r;

        if(rr==MX) rr--;
        a=convert(l);
        b=convert(rr);
      //  for(int i=0;i<18;i++) System.out.print(a[i]+" ");

        cc=new int[10];
        c=new int[10];
        generate(18,0);

       // pw.println(id);
//
//        for(int i=0;i<id;i++){
//            for(int j=0;j<10;j++) cc[j]=c[i][j];
//
//            if(go(0,1,1)) {
//                ans++;
//
//            }
//        }
//        Arrays.fill(cc,0);
        //cc[7]=18;
      //  pw.println(go(0,1,1));

      //  if(r==MX) ans++;
        pw.println(ans);
    }
    int a[],b[];
    int c[];
    int cc[];
    int id=0;
    int ans=0;
    boolean go(int i,int t1,int t2){
        if(i>=18) return true;
        int st=0,ed=9;

        if(t1==1 && t2==1){
             st=a[i]; ed=b[i];
           //  if(i==16) pw.println("YES"+" "+st+" "+ed);
             for(int j=st+1;j<ed;j++){

                 if(cc[j]>0){

                     return true;
                 }
             }

             if(st==ed){


                 if(cc[st]>0){
                     cc[st]--;
                     if(go(i+1,1,1)) return true;
                     cc[st]++;

                 }
             }else {
                 if(cc[st]>0){
                     cc[st]--;
                     if(go(i+1,1,0)) return true;
                     cc[st]++;
                 }
                 if(cc[ed]>0){
                     cc[ed]--;
                     if(go(i+1,0,1)) return true;

                     cc[ed]++;
                 }
             }

        }else if(t1==1){
            st=a[i];
            for(int j=st+1;j<=ed;j++){
                if(cc[j]>0) return true;
            }
            if(cc[st]>0){
                cc[st]--;
                if(go(i+1,1,0)) return true;
                cc[st]++;
            }

        }else if(t2==1){
            ed=b[i];
            for(int j=st;j<ed;j++) if(cc[j]>0) return true;
            if(cc[ed]>0){
                cc[ed]--;
                if(go(i+1,0,1)) return true;
                cc[ed]++;
            }
        }else {
            return true;
        }
        return false;
    }



    void generate(int i,int digit){

        if(i==0){

            for(int j=0;j<10;j++) cc[j]=c[j];

            if(go(0,1,1)) ans++;
            return;
        }
        if(digit>9) return;
        for(int j=0;j<=i;j++){
            c[digit]=j;
            generate(i-j,digit+1);
            c[digit]=0;

        }

    }
    int []convert(long n){
        int a[]=new int[18];
        int id=17;
        while(n>0){

            a[id]=(int)(n%10);
           // if(a[id]<0) System.out.println("YES");
            id--;
            n/=10;
        }
        return a;
    }



    long M=(long)1e9+7;
    InputStream is;
    PrintWriter pw;
    String INPUT = "";
    void run() throws Exception {
        is = INPUT.isEmpty() ? System.in : new ByteArrayInputStream(INPUT.getBytes());
        pw = new PrintWriter(System.out);
        long s = System.currentTimeMillis();
        solve();
        pw.flush();
        if(!INPUT.isEmpty())tr(System.currentTimeMillis()-s+"ms");

    }

    public static void main(String[] args) throws Exception { new Main().run(); }

    private byte[] inbuf = new byte[1024];
    public int lenbuf = 0, ptrbuf = 0;

    private int readByte() {
        if(lenbuf == -1)throw new InputMismatchException();
        if(ptrbuf >= lenbuf){
            ptrbuf = 0;
            try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
            if(lenbuf <= 0)return -1;
        }
        return inbuf[ptrbuf++];
    }

    private boolean isSpaceChar(int c) { return !(c >= 33 && c <= 126); }
    private int skip() { int b; while((b = readByte()) != -1 && isSpaceChar(b)); return b; }

    private double nd() { return Double.parseDouble(ns()); }
    private char nc() { return (char)skip(); }

    private String ns() {
        int b = skip();
        StringBuilder sb = new StringBuilder();
        while(!(isSpaceChar(b))){ // when nextLine, (isSpaceChar(b) && b != ' ')
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    private char[] ns(int n) {
        char[] buf = new char[n];
        int b = skip(), p = 0;
        while(p < n && !(isSpaceChar(b))){
            buf[p++] = (char)b;
            b = readByte();
        }
        return n == p ? buf : Arrays.copyOf(buf, p);
    }

    private char[][] nm(int n, int m) {
        char[][] map = new char[n][];
        for(int i = 0;i < n;i++)map[i] = ns(m);
        return map;
    }

    private int[] na(int n) {
        int[] a = new int[n];
        for(int i = 0;i < n;i++)a[i] = ni();
        return a;
    }

    private int ni() {
        int num = 0, b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }

    private long nl() {
        long num = 0;
        int b;
        boolean minus = false;
        while((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'));
        if(b == '-'){
            minus = true;
            b = readByte();
        }

        while(true){
            if(b >= '0' && b <= '9'){
                num = num * 10 + (b - '0');
            }else{
                return minus ? -num : num;
            }
            b = readByte();
        }
    }
    private boolean oj = System.getProperty("ONLINE_JUDGE") != null;
    private void tr(Object... o) { if(INPUT.length() > 0)System.out.println(Arrays.deepToString(o)); }
}