A positive integer is called a 2-3-integer, if it is equal to 2x·3y for some non-negative integers x and y. In other words, these integers are such integers that only have 2 and 3 among their prime divisors. For example, integers 1, 6, 9, 16 and 108 — are 2-3 integers, while 5, 10, 21 and 120 are not.Print the number of 2-3-integers on the given segment [l, r], i. e. the number of sich 2-3-integers t that l ≤ t ≤ r.

The only line contains two integers l and r (1 ≤ l ≤ r ≤ 2·109).

Print a single integer the number of 2-3-integers on the segment [l, r].

NoteIn the first example the 2-3-integers are 1, 2, 3, 4, 6, 8 and 9.In the second example the 2-3-integers are 108, 128, 144, 162 and 192.

import java.util.Scanner;

public class HelloWorld {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        long l = in.nextInt();
        long r = in.nextInt();
        int res = 0;
        for(int i = 0; i < 50; i += 1) {
            for(int j = 0; j < 50; j += 1) {
                long k = (long)Math.pow(3, i) * (long)Math.pow(2, j);
                if(k <= r && k >= l) {
                    res += 1;
                }
            }
        }
        System.out.println(res);
    }
}

import java.util.Scanner;
public class project{
    public static int solve(int n) {
        if (n==0)
         return 0;
       int cnt=0;
       int m=n;
       while(n>1){
           n=n/2;
           cnt=cnt+1;
       }
       int ans=0;
       for(int i=0;i<=cnt;i++){
           n=m;
    	    for(int j=1; j<=i ;j++) n/=2;
    	    ans=ans+1;
    	    while(n>=3){
    	        n/=3;
    	        ans=ans+1;
    	    }
	    }

       return ans;
    }
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int l =s.nextInt()-1, r=s.nextInt();
	/*for(int i=1;i<=n;i++){
	    int tmp=s.nextInt();
	    if(tmp>=memory && tmp>0)
		sum++;
	    if(i==k)
		memory=tmp;
	}*/
	System.out.println(solve(r)-solve(l));
    }
}

import java.util.*;
import java.io.*;
import java.math.*;

public class A{

	static long l,r; int res;
	static void MainMethod()throws Exception{
		long x,y,z; l=reader.nextLong();
		r=reader.nextLong();
		x=1; y=1;
		int res=0;
		while (y<=r) {
			x=y;
			while (x<=r) {
				if (x>=l) res++;
				x=x*2;
			}
			y=y*3;
		}
		printer.print(res);
	}
	public static void main(String[] args)throws Exception{
		MainMethod();
		printer.close();
	}
	static void halt(){
		printer.close();
		System.exit(0);
	}
	static PrintWriter printer=new PrintWriter(new OutputStreamWriter(System.out));
	static class reader{
		static BufferedReader bReader=new BufferedReader(new InputStreamReader(System.in));
		static StringTokenizer token=new StringTokenizer("");
		static String readNextLine() throws Exception{
			return bReader.readLine();
		}
		static String next() throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return token.nextToken();
		}
		static int nextInt()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Integer.parseInt(token.nextToken());
		}
		static long nextLong()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Long.parseLong(token.nextToken());
		}
		static double nextDouble()throws Exception{
			while (token.hasMoreTokens()==false){
				token=new StringTokenizer(bReader.readLine());
			}
			return Double.parseDouble(token.nextToken());
		}
	}
	static class MyMathCompute{
		static long [][] MatrixMultiplyMatrix(long [][] A, long [][] B, long mod) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			long [][] res=new long [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=(res[i][j]+((A[i][k]*B[k][j])% mod))% mod;
			}
			return res;
		}
		static double [][] MatrixMultiplyMatrix(double [][] A, double [][] B ) throws Exception{
			int n=A.length, m=B[0].length;
			int p=A[0].length;
			int i,j,k;
			if (B.length!=p) throw new Exception("invalid matrix input");
			double [][] res=new double [n][m];
			for (i=0;i<n;i++) for (j=0;j<m;j++){
				if (A[i].length!=p) throw new Exception("invalid matrix input");
				res[i][j]=0;
				for (k=0;k<p;k++)
					res[i][j]=res[i][j]+(A[i][k]*B[k][j]);
			}
			return res;
		}
		static long [][] MatrixPow(long [][] A,long n, long mod) throws Exception{
			if (n==1) return A;
			long [][] res=MatrixPow(A, n/2, mod);
			res=MatrixMultiplyMatrix(res, res, mod);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res, mod);
			return res;
		}
		static double [][] MatrixPow(double [][] A,long n) throws Exception{
			if (n==1) return A;
			double[][] res=MatrixPow(A, n/2);
			res=MatrixMultiplyMatrix(res, res);
			if ((n % 2) == 1) res=MatrixMultiplyMatrix(A,res);
			return res;
		}
		static long pow(long a,long n,long mod){
			a= a % mod;
			if (n==0) return 1;
			long k=pow(a,n/2,mod);
			if ((n % 2)==0) return ((k*k)%mod);
			else return (((k*k) % mod)*a) % mod;
		}
		static double pow(double a,long n){
			if (n==0) return 1;
			double k=pow(a,n/2);
			if ((n % 2)==0) return (k*k);
			else return (((k*k) )*a) ;
		}
	}
}

import java.util.*;
public class Atul
{
	public static void main(String[] args)
	{
		Scanner kb=new Scanner(System.in);
		Long l, r;
		l=kb.nextLong();
		r=kb.nextLong();
		ArrayList<Long> v = new ArrayList<Long>();
		Long x=1L;
		Long y=3L;
		Long temp=1L;
		v.add(x);
		v.add(y);

		while(2*x<=2000000000)
		{
			x*=2;
			v.add(x);
			temp=x;
			while(temp*3<=2000000000)
			{
				temp*=3;
				v.add(temp);
			}
		}
		while(3*y<=2000000000)
		{
			y*=3;
			v.add(y);
		}
		Collections.sort(v);
		int ans=0;
		Long b;
		for(int i=0;i<v.size();i++)
		{
		    b=v.get(i);
			if(b>=l&&b<=r)
			{
				ans++;
			}
			else if(b>r)break;
		}
		System.out.println(ans);
}}

import java.util.*;
public class Sol{
    public static void main (String[] args){
        Scanner input = new Scanner (System.in);
        long l = input.nextInt (), r = input.nextInt ();
        long a [] = new long [40], b [] = new long [40];
        a [0] = 1;
        int x, y;
        for (x = 1; x < 40; x ++){
            if (a [x - 1] > 2000000000 / 2) break;
            else a [x] = a [x - 1] * 2;
        }
        b [0] = 1;
        for (y = 1; y < 40; y ++){
            if (b [y - 1] > 2000000000 / 3) break;
            else b [y] = b [y - 1] * 3;
        }
        int ans = 0;
        for (int i = 0; i < x; i ++){
            for (int j = 0; j < y; j ++){
                long curr = a [i] * b [j];
                if (curr >= l && curr <= r) ans ++;
            }
        }
        System.out.println (ans);
    }
}

import java.lang.Math;
import java.util.Scanner;

public class HelloWorld
{
  public static void main(String[] args)
  {
    Scanner scanner = new Scanner(System.in);
    long l = scanner.nextLong();
    long r = scanner.nextLong();
    long p = 1;
    long p1 = 1;
    long answer = 0;
    for(int i = 0; i <= 30; i++, p *= 2, p1 = 1)
      for(int j = 0; j <= 20; j++, p1 *= 3) {
      	long number = p * p1;
        if(number >= l && number <= r)
          answer++;
    }
    System.out.println(answer);
  }
}

import java.util.Scanner;

public class Two_3Number {
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner in=new Scanner(System.in);
		int l = in.nextInt();
		int r=in.nextInt();
		int counter=0;
		for(int i=0; i<32; i++){
			for(int j=0; j<21; j++){
				long ans=(long) (Math.pow(2, i)*Math.pow(3, j));
				if(ans>=l && ans<=r){
					counter++;
				}
			}
		}
		System.out.println(counter);
	}
}

import java.util.Scanner;

public class project{
    static long x[], y[];

    public static void main(String[]args){
              x = new long[100];
              y = new long[100];

	Scanner in = new Scanner(System.in);

	long f, l;
	f = in.nextLong();
	l = in.nextLong();

	int a = 0, b = 0;

	for(long i = 1; i<=l; i*=2)  x[a++] = i;

	for(long i = 1; i<=l; i*=3) y[b++] = i;

	int sum = 0;

	for(int i = 0; i<a; i++){
	          for(int j = 0; j<b; j++){

	                    long c = x[i]*y[j];
	                    if(c>=f && c<=l) sum++;
	          }
	}

	System.out.println(sum);
    }
}

import java.io.*;
import java.util.*;
public class test
{
	public static void main (String[] args) throws java.lang.Exception
	{
	    Scanner cin=new Scanner(System.in);
        long a = cin.nextInt(), b = cin.nextInt() ,c = 0;
	    for(long i=1;i<=b;i=i*2)
            for(long j=1;j*i<=b;j=j*3)
                if(i*j>=a)
                    c=c+1;
        System.out.println(c);
	}
}

import java.util.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		long a2[] = new long[1100];
		long a3[] = new long[1100];
		int size2 = 0, size3 = 0;
		a2[0] = 1;
		a3[0] = 1;
		for (int i = 1; i < 100; i++)
		{
			a2[i] = a2[i - 1] * 2;
			if (a2[i] > r)
			{
				size2 = i;
				break;
			}
		}
		for (int i = 1; i < 100; i++)
		{
			a3[i] = a3[i - 1] * 3;
			if (a3[i] > r)
			{
				size3 = i;
				break;
			}
		}
		long ans = 0;
		for (int i = 0; i <= size2; i++)
	{
		for (int j = 0; j <= size3; j++)
		{
			if (a2[i] * a3[j] <= r && a2[i] * a3[j] >= l)
				ans++;
		}
	}
	System.out.println(ans);
	}
}

import java.io.*;
import java.util.*;
import java.math.*;

public class TaskA {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        BigInteger a = in.nextBigInteger();
        BigInteger b = in.nextBigInteger();

        BigInteger TWO = BigInteger.ONE.add(BigInteger.ONE);
        BigInteger THREE = TWO.add(BigInteger.ONE);
        int result = 0;
        for (int i = 0; i < 32; ++i) {
            for (int j = 0; j < 25; ++j) {
                BigInteger x = TWO.pow(i).multiply(THREE.pow(j));
                if (x.compareTo(a) >= 0 && x.compareTo(b) <= 0) {
                    result += 1;
                }
            }
        }
        System.out.println(result);
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintStream;
import java.io.OutputStream;
import java.io.PrintWriter;
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
 *
 * @author prakharjain
 */
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);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, InputReader in, OutputWriter out) {
            long l = in.nextLong();
            long r = in.nextLong();

            long ans = 0;
            for (long i = 0; i <= 31; i++) {
                for (int j = 0; j <= 19; j++) {
                    long num = 1;

                    num *= Math.pow(2, i);

                    num *= Math.pow(3, j);

                    if (num >= l && num <= r) {
                        ans++;
                    }
                }
            }

            System.out.println(ans);
        }

    }

    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();
        }

    }

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

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

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    private static int count;
    private static int l;
    private static int r;

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

        StringTokenizer tokenizer = new StringTokenizer(reader.readLine());
        l = Integer.parseInt(tokenizer.nextToken());
        r = Integer.parseInt(tokenizer.nextToken());

        check(1, true);
        System.out.println(String.valueOf(count));
    }

    public static void check(long i, boolean two){
        if(i >= l && i <= r){
            count++;
        }

        if(i < r){
            if(two){
                check(i << 1, true);
            }
            check((i << 1) + i, false);
        }
    }
}

import java.util.*;
public class Main {
    public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		long r = sc.nextLong();
		HashSet<Long> list = new HashSet<>();
		long count = 0;
		long math = 0;
		for(int i=0;i<=30;i++){
			for(int j=0;j<=30;j++){
				math = (long) (Math.pow(2,i)*Math.pow(3,j));
				if(math>=l && math<=r)
					list.add(math);
			}
		}
		System.out.print(list.size());
	}
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class main {

    public  static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        tk = new StringTokenizer(in.readLine());
        long l = parseInt(tk.nextToken());
        long r = parseInt(tk.nextToken());
        long s = 0;
        for(long i=1;i<=r;i*=2){
            for(long j=1;j<=r;j*=3){
                if(i*j>=l && (i*j<=r))
                    s++;
            }
        }
        System.out.println(s);
    }

}

import java.math.BigInteger;
import java.util.*;
import java.util.function.BinaryOperator;

public class Main {
    public static void main(String[] args) {
            new FF().Hi();
    }

    static class FF{
        final Scanner sc;
        BigInteger l , r;
        public FF() {
             sc=  new Scanner(System.in);
        }

        void Hi(){
            l = sc.nextBigInteger();
            r = sc.nextBigInteger();
            long ans = 0;
            for (int i = 0; i < 32; i++) {
                BigInteger p = new BigInteger(String.valueOf((long) Math.pow(2, i)));
                int cmp  = p.compareTo(r);
                if(cmp ==1) break;
                for (int j = 0; j < 21; j++) {
                    BigInteger q =  new BigInteger(String.valueOf((long) Math.pow(3, j)));
                    BigInteger oo = new BigInteger(String.valueOf(q.multiply(p)));
                    int cmpo = oo.compareTo(l);
                    int cmpt = oo.compareTo(r);
                    if(cmpo>=0 && cmpt<=0)ans++;

                }
            }
            System.out.println(ans);
        }
    }
}

import java.util.Scanner;
public class A{
	public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong() ,r = sc.nextLong();
		long cur = 1L,val ,ans = 0L;
		while(cur <= r){
			val = cur;
			while(val <= r){
				if(val >= l && val <= r)	ans++;
				val *= 3L;
			}
		cur *= 2L;
		}
		System.out.println(ans);
	}
}

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Numbers23{
	static int stoi(String s){return Integer.parseInt(s);}

	public static void main(String[] args) throws Exception{
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in));

		String[] l1 = r.readLine().split(" ");
		int lo = stoi(l1[0]);
		int hi = stoi(l1[1]);
		int res = 0;

		for(long i = 1; i <= hi; i *= 2){
			for(long j = 1; j <= hi; j *= 3){
				if(i * j >= lo && i * j <= hi){
					res++;
				}
			}
		}

		System.out.println(res);

		r.close();
	}
}

import java.util.HashSet;
import java.util.Scanner;

public class numbers23 {

    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        HashSet<Integer> h = new HashSet<Integer>();
        for (int j = 0; Math.pow(2, j) <= b; j++) {
            if (Math.pow(2, j) >= a && Math.pow(2, j) <= b) {
                h.add((int) Math.pow(2, j));
            }
            if (Math.pow(3, j) >= a && Math.pow(3, j) <= b) {
                h.add((int) Math.pow(3, j));
            }

        }
        for (int i = 0; Math.pow(2, i) <= b; i++) {
            for (int j = 0; Math.pow(3, j) <= b; j++) {
                if (Math.pow(3, j) * Math.pow(2, i) >= a && Math.pow(3, j) * Math.pow(2, i) <= b) {
                    h.add((int) Math.pow(3, j) * (int) Math.pow(2, i));
                }
            }

        }
        System.out.println(h.size());

    }
}

import java.util.*;
import java.io.*;

public class Solution{
    public static void main(String []argh)
    {

        Scanner sc = new Scanner(System.in);
        long m=sc.nextLong();
        long n=sc.nextLong();
        long p2=1,p3=1;
        int cnt=0;
        int cnt1=0;
        while(p2<=n)
        {
            cnt1++; p3=p2*3L;
            while(p3<=n)
            {
                p3*=3L;
                cnt1++;
            }
            p2*=2L;
        }
       // System.out.println(cnt1);
        m--;
        p2=1;
        while(p2<=m)
        {
            cnt++; p3=p2*3L;
            while(p3<=m)
            {
                p3*=3L;
                cnt++;
            }
            p2*=2L;
        }
        System.out.println(cnt1-cnt);
    }
}

import java.io.*;
import java.util.stream.Stream;

/**
 * @author madi.sagimbekov
 */
public class C926A {

    private static BufferedReader in;
    private static BufferedWriter out;

    public static void main(String[] args) throws IOException {
        open();

        int[] x = readInts();
        int l = x[0];
        int r = x[1];

        int ans = 0;
        for (int i = 0; i <= 32; i++) {
            for (int j = 0; j <= 20; j++) {
                long num = (long)Math.pow(2, i) * (long)Math.pow(3, j);
                if (num >= l && num <= r) {
                    ans++;
                }
            }
        }

        out.write(ans + "\n");

        close();
    }

    private static int[] readInts() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToInt(Integer::parseInt).toArray();
    }

    private static int readInt() throws IOException {
        return Integer.parseInt(in.readLine());
    }

    private static long[] readLongs() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToLong(Long::parseLong).toArray();
    }

    private static long readLong() throws IOException {
        return Long.parseLong(in.readLine());
    }

    private static double[] readDoubles() throws IOException {
        return Stream.of(in.readLine().split(" ")).mapToDouble(Double::parseDouble).toArray();
    }

    private static double readDouble() throws IOException {
        return Double.parseDouble(in.readLine());
    }

    private static String readString() throws IOException {
        return in.readLine();
    }

    private static void open() {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new BufferedWriter(new OutputStreamWriter((System.out)));
    }

    private static void close() throws IOException {
        out.flush();
        out.close();
        in.close();
    }

}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt(),r=sc.nextInt();
        int count=0;
        for(long x=1;x<=r;x*=2){
            for(long y=1;x*y<=r;y*=3){
                if(x*y>=l) count++;
            }
        }
        System.out.println(count);
    }

}

import java.util.*;
public class Main{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);
        long l = sc.nextLong();
        long r = sc.nextLong();
        long ans = 0;
        HashSet<Long> set = new HashSet();
        for(long i=0;i<=40;i++)
        {
            for(long j=0;j<=20;j++)
            {
                long p = (long)Math.pow(2,i);
                p*=(long)Math.pow(3,j);
                if(p>=l&&p<=r)
                set.add(p);
            }
        }
        System.out.println(set.size());
    }
}

import java.util.Scanner;
public class TestMain {
    public static void main(String[] args) {
          Scanner in = new Scanner(System.in);
          int l = in.nextInt();
          int r = in.nextInt();
          int sum = 0;
          for (long i = 1; i <= r; i *= 2)
            for (long j = 1; j <= r; j *= 3) {
                if (i * j > r) break;
                if (i * j >= l && i * j <= r) sum ++;
            }
          System.out.println(sum);
    }
}

import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeSet;

public class P953A
{
	static long MAX = 2000000000;
	public static void main(String[] args)
	{
		ArrayList<Long> pow2 = new ArrayList<>();
		ArrayList<Long> pow3 = new ArrayList<>();
		long pow = 1;
		while (pow <= MAX)
		{
			pow2.add(pow);
			pow *= 2;
		}
		pow = 1;
		while (pow <= MAX)
		{
			pow3.add(pow);
			pow *= 3;
		}
		TreeSet<Long> set = new TreeSet<>();
		for (int i = 0; i < pow2.size(); i++)
			for (int j = 0; j < pow3.size(); j++)
				set.add(pow2.get(i)*pow3.get(j));
		set.add(Long.MAX_VALUE);
		Scanner scan = new Scanner(System.in);
		long a = scan.nextLong();
		long b = scan.nextLong();
		int cnt = 0;
		while (a <= b)
		{
			a = set.ceiling(a);
			if (a > b)
				break;
			cnt++;
			a++;
		}
		System.out.println(cnt);
	}
}

import java.util.Scanner;

/**
 * created at 18/04/20 6:11 PM
 */
public class P926A {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    int l = input.nextInt();
    int r = input.nextInt();

    System.out.println(get(r) - get(l - 1));
  }

  private static int get(long x) {
    if (x <= 0) {
      return 0;
    }

    int cnt = 0;

    for (long i = 1; i <= x; i *= 2) {
      for (long j = 1; j <= x; j *= 3) {
        if (i * j <= x) {
          cnt++;
        }
      }
    }

    return cnt;
  }
}

import java.util.*;

public class Sol {
  public static long powerN(int number, int power) {
    return (long) Math.pow(number, power);
  }

	public static void main(String[] argc){
	   ArrayList<Long> al = new ArrayList<Long>();
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		for (int i = 0; i < 33; i++) {
		  for (int j = 0; j + i < 33; j++) {
		    Long v =  (Long) powerN(2, i) * powerN(3, j);
		    al.add(v);
		  }
		}
		Collections.sort(al);
		int cnt = 0;
		for (Long v: al) {
		  if (v >= l && v <= r)
		    cnt++;
		}
		System.out.println(cnt);
	}
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }

    public static int lowerBound(ArrayList<Long>number,long ch) {
        int low = 0;
        int high = number.size();
        while (low < high) {
            final int mid = (low + high) / 2;
            if (ch <= number.get(mid)) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }
        return low;
    }

    public static int upperBound(ArrayList<Long>number,long ch) {
        int low = 0;
        int high = number.size();
        while (low < high) {
            final int mid = (low + high) / 2;
            if (ch >= number.get(mid)) {
                low = mid + 1;
            } else {
                high = mid;
            }
        }
        return low;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        nums.add((long)0);
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
            s= lowerBound(nums,a);
            f= upperBound(nums,b);
            if(a==b&&nums.get(f)==a) System.out.println(1);
            else {
                    System.out.println(Math.max(f - s, 0));
            }

    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
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
 *
 * @author El-Bishoy
 */
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);
        Task2_3_numbers solver = new Task2_3_numbers();
        solver.solve(1, in, out);
        out.close();
    }

    static class Task2_3_numbers {
        public void solve(int testNumber, InputReader in, OutputWriter out) {

            int l = in.nextInt();
            int r = in.nextInt();

            long currentNum = 0;

            int count = 0;
            for (int i = 0; i <= 30; i++) {

                for (int j = 0; j <= 30; j++) {

                    currentNum = (long) (Math.pow(2, i) * Math.pow(3, j));
                    if (currentNum >= l && currentNum <= r)
                        count++;

                }
            }

            out.println(count);

        }

    }

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

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

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    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);
        }

    }
}

import java.util.Scanner;
public class project{
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int l =s.nextInt(),r =s.nextInt();
	long pr=1;
	int kol=0;
	for(;pr<=r;pr*=2){
	    long pr1=1;
	    for(;pr*pr1<=r;pr1*=3) if(pr*pr1>=l && pr*pr1<=r) kol=kol+1;
	}
	System.out.println(kol);
    }
}

import java.util.*;
import java.io.*;
import java.lang.*;

public class codes_1
	{

		public static void main(String[] args)
		{
			InputReader in = new InputReader(System.in);
			PrintWriter pw = new PrintWriter(System.out);

			//Code starts..

			int l = in.nextInt();
			int r = in.nextInt();
			ArrayList<Long> list = new ArrayList<>();
			for(int i=0; Math.pow(2, i)<20000000009L; i++)
				for(int j=0; Math.pow(3, j)<2000000009L; j++)
					{
					long tmp = (long)Math.pow(2, i)*(long)Math.pow(3, j);
					if(tmp<2000000000L)
						list.add(tmp);
					}

			Collections.sort(list);
			//for(int i=0; i<20; i++)
				//pw.println(list.get(i));

			pw.println(lowerbound(list, r) - uperbound(list, l)+1);

			//Code ends....

			pw.flush();
			pw.close();
		}

		static class InputReader
		{

			private final InputStream stream;
			private final byte[] buf = new byte[8192];
			private int curChar, snumChars;
			private SpaceCharFilter filter;

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

			public int snext()
			{
				if (snumChars == -1)
					throw new InputMismatchException();
				if (curChar >= snumChars)
				{
					curChar = 0;
					try
					{
						snumChars = stream.read(buf);
					}
					catch (IOException e)
					{
						throw new InputMismatchException();
					}
					if (snumChars <= 0)
						return -1;
				}
				return buf[curChar++];
			}

			public int nextInt()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-')
			    {
					sgn = -1;
					c = snext();
				}
				int res = 0;
				do
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}

			public long nextLong()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				int sgn = 1;
				if (c == '-')
				{
					sgn = -1;
					c = snext();
				}
				long res = 0;
				do
				{
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					res *= 10;
					res += c - '0';
					c = snext();
				} while (!isSpaceChar(c));
				return res * sgn;
			}

			public int[] nextIntArray(int n)
			{
				int a[] = new int[n];
				for (int i = 0; i < n; i++)
				{
					a[i] = nextInt();
				}
				return a;
			}

			public String readString()
		    {
				int c = snext();
				while (isSpaceChar(c))
				{
					c = snext();
				}
				StringBuilder res = new StringBuilder();
				do
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isSpaceChar(c));
				return res.toString();
			}

			public String nextLine()
			{
				int c = snext();
				while (isSpaceChar(c))
					c = snext();
				StringBuilder res = new StringBuilder();
				do
				{
					res.appendCodePoint(c);
					c = snext();
				} while (!isEndOfLine(c));
				return res.toString();
			}

			public boolean isSpaceChar(int c)
			{
				if (filter != null)
					return filter.isSpaceChar(c);
				return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
			}

			private boolean isEndOfLine(int c)
			{
				return c == '\n' || c == '\r' || c == -1;
			}

			public interface SpaceCharFilter
		    {
				public boolean isSpaceChar(int ch);
			}
		}
		public static long c = 0;

		public static long mod = 1000000007;
		public static int d;
		public static int p;
		public static int q;

		public static  int gcd(int p2, int p22)
		{
		    if (p2 == 0)
		        return (int) p22;
		    return gcd(p22%p2, p2);
		}

		public static int findGCD(int arr[], int n)
		{
		    int result = arr[0];
		    for (int i=1; i<n; i++)
		        result = gcd(arr[i], result);

		    return result;
		}

	    public static long lcm(int[] numbers) {
	        long lcm = 1;
	        int divisor = 2;
	        while (true) {
	            int cnt = 0;
	            boolean divisible = false;
	            for (int i = 0; i < numbers.length; i++) {
	                if (numbers[i] == 0) {
	                    return 0;
	                } else if (numbers[i] < 0) {
	                    numbers[i] = numbers[i] * (-1);
	                }
	                if (numbers[i] == 1) {
	                    cnt++;
	                }
	                if (numbers[i] % divisor == 0) {
	                    divisible = true;
	                    numbers[i] = numbers[i] / divisor;
	                }
	            }
	            if (divisible) {
	                lcm = lcm * divisor;
	            } else {
	                divisor++;
	            }
	            if (cnt == numbers.length) {
	                return lcm;
	            }
	        }
	    }
		public static long fact(long n) {

			long factorial = 1;
			 for(int i = 1; i <= n; i++)
		        {
		            factorial *= i;
		        }
			 return factorial;
		}

		public static int lowerLimit(int[] a, int n) {
			int ans = 0;

			int ll = 0;
			int rl = a.length-1;
		//	System.out.println(a[rl]+" "+n);
			if(a[0]>n)
				return 0;
			if(a[0]==n)
				return 1;
			else if(a[rl]<=n)
				return rl+1;

			while(ll<=rl)
			{

				int mid = (ll+rl)/2;
				if(a[mid]==n)
				{
					ans = mid + 1;
					break;
				}

				else if(a[mid]>n)
				{
					rl = mid-1;

				}
				else
				{
					ans = mid+1;
					ll = mid+1;
				}
			}

			return ans;
		}

		public static long choose(long total, long choose){
		    if(total < choose)
		        return 0;
		    if(choose == 0 || choose == total)
		        return 1;
		    return (choose(total-1,choose-1)+choose(total-1,choose))%mod;
		}

		public static int[] suffle(int[] a,Random gen)
		{
			int n = a.length;
			for(int i=0;i<n;i++)
			{
				int ind = gen.nextInt(n-i)+i;
				int temp = a[ind];
				a[ind] = a[i];
				a[i] = temp;
			}
			return a;
		}

		public static int floorSearch(int arr[], int low, int high, int x)
		{
		    if (low > high)
		        return -1;

		    if (x > arr[high])
		        return high;
		    int mid = (low+high)/2;

		    if (mid > 0 && arr[mid-1] < x && x < arr[mid])
		        return mid-1;

		    if (x < arr[mid])
		        return floorSearch(arr, low, mid-1, x);

		    return floorSearch(arr, mid+1, high, x);
		}

	/*	public static void swap(int a, int b){
			int temp = a;
			a = b;
			b = temp;
		}
		*/
		public static ArrayList<Integer> primeFactorization(int n)
		{
			ArrayList<Integer> a =new ArrayList<Integer>();
			for(int i=2;i*i<=n;i++)
			{
				while(n%i==0)
				{
					a.add(i);
					n/=i;
				}
			}
			if(n!=1)
				a.add(n);
			return a;
		}

		public static void sieve(boolean[] isPrime,int n)
		{
			for(int i=1;i<n;i++)
				isPrime[i] = true;

			isPrime[0] = false;
			isPrime[1] = false;

			for(int i=2;i*i<n;i++)
			{
				if(isPrime[i] == true)
				{
					for(int j=(2*i);j<n;j+=i)
						isPrime[j] = false;
				}
			}
		}

		public static int GCD(int a,int b)
		{
			if(b==0)
				return a;
			else
				return GCD(b,a%b);
		}

		public static long GCD(long a,long b)
		{
			if(b==0)
				return a;
			else
				return GCD(b,a%b);
		}

		public static void extendedEuclid(int A,int B)
		{
			if(B==0)
			{
				d = A;
				p = 1 ;
				q = 0;
			}
			else
			{
				extendedEuclid(B, A%B);
				int temp = p;
				p = q;
				q = temp - (A/B)*q;
			}
		}

		public static int lowerbound(ArrayList<Long> list, long n) {
			int i=Collections.binarySearch(list, n);
			if(i<0)
				i = -(i+2);
			return i;

		}
		public static int uperbound(ArrayList<Long> list, long n) {
			int i=Collections.binarySearch(list, n);
			if(i<0)
				i = -(i+1);
			return i;

		}

		public static long LCM(long a,long b)
		{
			return (a*b)/GCD(a,b);
		}

		public static int LCM(int a,int b)
		{
			return (a*b)/GCD(a,b);
		}

		public static int binaryExponentiation(int x,int n)
		{
		    int result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=result * x;
		        x=x*x;
		        n=n/2;
		    }
		    return result;
		}

		public static int[] countDer(int n)
	    {
	        int der[] = new int[n + 1];

	        der[0] = 1;
	        der[1] = 0;
	        der[2] = 1;

	        for (int i = 3; i <= n; ++i)
	            der[i] = (i - 1) * (der[i - 1] + der[i - 2]);

	        // Return result for n
	        return der;
	    }

		 static long binomialCoeff(int n, int k)
		    {
		    long C[][] = new long[n+1][k+1];
		    int i, j;

		        // Calculate  value of Binomial Coefficient in bottom up manner
		    for (i = 0; i <= n; i++)
		    {
		        for (j = 0; j <= Math.min(i, k); j++)
		        {
		            // Base Cases
		            if (j == 0 || j == i)
		                C[i][j] = 1;

		            // Calculate value using previosly stored values
		            else
		                C[i][j] = C[i-1][j-1] + C[i-1][j];
		          }
		     }

		    return C[n][k];
		    }

		public static long binaryExponentiation(long x,long n)
		{
		    long result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=result * x;
		        x=(x%mod * x%mod)%mod;
		        n=n/2;
		    }
		    return result;
		}

		public static int modularExponentiation(int x,int n,int M)
		{
		    int result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=(result * x)%M;
		        x=(x*x)%M;
		        n=n/2;
		    }
		    return result;
		}

		public static long modularExponentiation(long x,long n,long M)
		{
		    long result=1;
		    while(n>0)
		    {
		        if(n % 2 ==1)
		            result=(result * x)%M;
		        x=(x*x)%M;
		        n=n/2;
		    }
		    return result;
		}

		public static int modInverse(int A,int M)
		{
		    return modularExponentiation(A,M-2,M);
		}

		public static long modInverse(long A,long M)
		{
		    return modularExponentiation(A,M-2,M);
		}

		public static boolean isPrime(int n)
		{

		    if (n <= 1)  return false;
		    if (n <= 3)  return true;

		    if (n%2 == 0 || n%3 == 0)
		    	return false;

		    for (int i=5; i*i<=n; i=i+6)
		    {
		        if (n%i == 0 || n%(i+2) == 0)
		           return false;
		    }

		    return true;
		}

		static class pair implements Comparable<pair>

		{
			Integer x, y;
			pair(int x,int y)
			{
				this.x=x;
				this.y=y;
			}

			public int compareTo(pair o) {
				int result = x.compareTo(o.x);
				if(result==0)
					result = y.compareTo(o.y);

				return result;
			}

			public String toString()
			{
				return x+" "+y;
			}

			public boolean equals(Object o)
			{
				if (o instanceof pair)
			    {
					pair p = (pair)o;
					return p.x == x && p.y == y ;
				}
				return false;
			}

			public int hashCode()
			{
				return new Long(x).hashCode()*31 + new Long(y).hashCode();
			}
		}

		static class triplet implements Comparable<triplet>
		{
			Integer x,y,z;
			triplet(int x,int y,int z)
			{
				this.x = x;
				this.y = y;
				this.z = z;
			}

			public  int compareTo(triplet o)
			{
				int result = x.compareTo(o.x);
				if(result==0)
					result =  y.compareTo(o.y);
				if(result==0)
					result = z.compareTo(o.z);

				return result;
			}

			public boolean equlas(Object o)
			{
				if(o instanceof triplet)
				{
					triplet p = (triplet)o;
					return x==p.x && y==p.y && z==p.z;
				}
				return false;
			}

			public String toString()
			{
				return x+" "+y+" "+z;
			}
			public int hashCode()
			{
				return new Long(x).hashCode()*31 + new Long(y).hashCode() + new Long(z).hashCode();
			}
		}

		static class node implements Comparable<node>

		{
			Integer x, y, z;
			node(int x,int y, int z)
			{
				this.x=x;
				this.y=y;
				this.z=z;
			}

			public int compareTo(pair o) {
				int result = x.compareTo(o.x);
				if(result==0)
					result = y.compareTo(o.y);
				if(result==0)
					result = z.compareTo(z);
				return result;
			}

			@Override
			public int compareTo(node o) {
				// TODO Auto-generated method stub
				return 0;
			}
		}
	}

import java.util.*;

public class Main{
	public static void main(String[] argc){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextInt();
		long r = sc.nextInt();
		long ans = 0;
		for (int x=0;x<=33;x++){
	            long a = (long)Math.pow(2,x);
	            for (int y=0;y<=22;y++){
	                long b = (long)Math.pow(3,y);
	                if (a * b >= l && a * b <= r ){
	                    ans ++;
	                }
	            }
		}
		System.out.println(ans);
	}
}

import java.util.*;
import java.io.*;

public class Main{ //имя класса должно быть Main
  public static void main(String[] argv) throws IOException{
    new Main().run();
  }
  PrintWriter pw;
  Scanner sc;
  public void run() throws IOException{
    sc = new Scanner(System.in);
    int l=sc.nextInt(), r=sc.nextInt();
    int ans = 0;
    long cur = 1;
    while (cur <= r) {
        long old_cur = cur;
        while (cur <= r) {
            if (l <= cur) {
                ++ans;
            }
            cur *= 3;
        }
        cur = old_cur * 2;
    }
    pw = new PrintWriter(System.out);
    pw.print(ans);
    pw.close();
  }
}

import java.util.*;
import java.io.*;
import java.text.*;
public class T{
    static final long mod = (long)163577857, root = 23;
    static int MAX = (int)2e5+1, A = 26;
    static FastReader in;

    public static void main(String[] args) throws Exception{
        in = new FastReader();
        long l = nl()-1, r = nl();
        pn(count(r)-count(l));
    }

    static long count(long l){
        long x = 1, count = 0;
        while(x<=l){
            long y = 1;
            while(x*y<=l){
                count++;
                y*=3;
            }
            x<<=1;
        }
        return count;
    }

    static long[] la(int n){
        long[] t = new long[n];
        for(int i = 0; i< n; i++)t[i] = nl();
        return t;
    }

    static int[] ia(int n){
        int[] t = new int[n];
        for(int i = 0; i< n; i++)t[i] = ni();
        return t;
    }

    static void p(Object o){
        System.out.print(o);
    }

    static void pn(Object o){
        System.out.println(o);
    }

    static String n(){
        return in.next();
    }

    static String nln(){
        return in.nextLine();
    }

    static int ni(){
        return Integer.parseInt(in.next());
    }

    static long nl(){
            return Long.parseLong(in.next());
    }

    static double nd(){
        return Double.parseDouble(in.next());
    }

    static class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public FastReader(String s) throws Exception{
            br = new BufferedReader(new FileReader(s));
        }

        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        String nextLine(){
            String str = "";
            try{
                str = br.readLine();
            }catch (IOException e){
                e.printStackTrace();
            }
            return str;
        }
    }
}

import java.util.*;
import java.lang.Math;

public class Main{
    public static void main(String[] args) {
      // Use the Scanner class
        Scanner sc = new Scanner(System.in);
        long l, r;
        l = sc.nextInt();
        r = sc.nextInt();
        int k = 0;
        for (int x = 0; x < 31; x++) {
            for (int y = 0; y < 31; y++) {
                long m = (int)(Math.pow(2, x) * Math.pow(3f, y));
                if (m >= l && m <= r)
                    k += 1;
            }

        }
        System.out.println(k);

      /*
      int n      = sc.nextInt();        // read input as integer
      long k     = sc.nextLong();       // read input as long
      double d   = sc.nextDouble();     // read input as double
      String str = sc.next();           // read input as String
      String s   = sc.nextLine();       // read whole line as String
      */
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class TaskC {

    FastScanner in;

    public void solve() {
        int left = in.nextInt();
        int right = in.nextInt();
        int res = 0;
        String str = Integer.toBinaryString(left);
        int pos  = str.length() - 1;
        long num = (long)Math.pow(2,pos);
        if (num < left) {
            num = num * 2;
        }
        long cur = num;
        while (cur <= right) {
            res++;
            long cur2 = cur * 3;
            while (cur2 <= right) {
                res++;
                cur2 = cur2 * 3;
            }
            cur = cur * 2;
        }
        cur = num/2;
        while (cur > 0) {
            long cur2 = cur;
            while (cur2 < left) {
                cur2 = cur2 * 3;
            }
            while (cur2 <=right) {
                res++;
                cur2 = cur2*3;
            }
            cur = cur / 2;
        }

        System.out.println(res);

    }
    public void run() {
        in = new FastScanner();
        solve();

    }

    class FastScanner {

        BufferedReader br;
        StringTokenizer st;
        String str;
        FastScanner() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {

                try {
                    str = br.readLine();
                    if (str == null) {
                        return "";
                    }
                    else {
                        st = new StringTokenizer(str);
                    }
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }
    }

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

import java.util.*;
public class A926 {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		HashSet<Long> set=new HashSet<>();
		long l=sc.nextLong();
		long r=sc.nextLong();
		long a[]=new long[1000];
		int k=1;
		a[0]=1;
		int i=0;
		while(true){

			if(a[i]*2<=2000000000l&&!(set.contains(a[i]*2))){
				set.add(a[i]*2);
				a[k++]=a[i]*2;
			}
			if(a[i]*3<=2000000000l&&!(set.contains(a[i]*3))){
				set.add(a[i]*3);
				a[k++]=a[i]*3;
			}
			i++;
			if(i==k)
				break;
		}
		int cnt=0;
		for( i=0;i<k;i++){
			if(a[i]>=l&&a[i]<=r)
				cnt++;
		}
		System.out.println(cnt);

	}
}

import java.io.*;
import java.math.BigInteger;
import java.math.BigDecimal;
import java.util.*;

public class Main {
    public static void main(String args[]) throws IOException {
    	Scanner in = new Scanner(System.in);
		int a = in.nextInt();
		int b = in.nextInt();
		long now=1;
		int ans=0;
		for(int i=0;i<=32;i++){
		    long now2=now;
		    for (int j=0;j<=32;j++){
		        if (now2>2e9){
		            break;
		        }else{
		            if (now2>=a&&now2<=b){
		                ans++;
		            }
		        }
		        now2*=3;
		    }
		    now*=2;
		}
		System.out.print(ans);
    }
}

import java.io.*;
import java.util.*;

public class Pro
{
    public static void main(String[] args)
    {
        Scanner cin = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
        int a = cin.nextInt();
        int b = cin.nextInt();
        int q = 0;
        for(int i = 0; i < 40; i++)
        {
            for(int j = 0; j < 40; j++)
            {
                long kk = 1;
                for (int x = 0; x < i; x++)
                {
                    kk = kk * 2;
                }
                for (int y = 0; y < j; y++)
                {
                    kk = kk * 3;
                    if (kk > 2000000000)
                        break;
                }
                //out.println(kk);
                if (a <= kk && kk <= b)
                    q++;
            }
        }
        out.println(q);
        out.flush();
    }
}

//package algoprog.level3.d.a;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class T23Numbers {

    public static void main(String[] args) throws IOException {
        final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        final StringTokenizer st = new StringTokenizer(br.readLine());

        int l = Integer.parseInt(st.nextToken());
        int r = Integer.parseInt(st.nextToken());

        List<Integer> twos = new ArrayList<>();
        Set<Long> all = new HashSet<>();

        long cur = 1;
        while (cur <= r) {
            twos.add((int) cur);
            if (cur >= l && cur <= r) {
                all.add(cur);
            }
            cur *= 2;
        }

        cur = 3;
        while (cur <= r) {
            for (Integer two : twos) {
                final long next = cur * two;
                if (toAdd(next, l, r, all)) {
                    all.add(next);
                } else if (next > r) {
                    break;
                }
            }
            if (toAdd(cur, l, r, all)) {
                all.add(cur);
            }

            cur *= 3;
        }

        System.out.println(all.size());
    }

    private static boolean toAdd(long next, int l, int r, Set<Long> set) {
        return next >= l && next <= r && !set.contains(next);
    }

}

import java.util.Scanner;
import java.util.TreeMap;

public class Main
{
	static TreeMap<Long, Boolean> map=new TreeMap<Long, Boolean>();
	static int l, r;
	static int count=0;
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		l=s.nextInt();
		r=s.nextInt();
		int min=(int)(Math.log(l)/Math.log(3));
		int max=(int)(Math.log(r)/Math.log(2));
		for(int a=min;a<=max;a++)
		{
			function(a);
		}
		System.out.println(count);
		s.close();
	}
	private static void function(int n)
	{
		for(int a=0;a<=n;a++)
		{
			Long temp=new Double(Math.pow(2, a)*Math.pow(3, n-a)).longValue();
			if(temp>=l&&temp<=r&&map.get(temp)==null)
			{
				count++;
				map.put(temp, true);
			}
		}
	}
}

import java.util.Scanner;

public class project{
    static long x[], y[];

    public static void main(String[]args){
              x = new long[100];
              y = new long[100];

	Scanner in = new Scanner(System.in);

	long f, l;
	f = in.nextLong();
	l = in.nextLong();

	int a = 0, b = 0;

	for(long i = 1; i<=l; i*=2)  x[a++] = i;

	for(long i = 1; i<=l; i*=3) y[b++] = i;

	int sum = 0;

	for(int i = 0; i<a; i++){
	          for(int j = 0; j<b; j++){

	                    long c = x[i]*y[j];
	                    if(c>=f && c<=l) sum++;
	          }
	}

	System.out.println(sum);
    }
}

import java.util.Scanner;

public class Task_1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int left = scanner.nextInt();
        int right = scanner.nextInt();

        int c = 0;
        for (int i = 0; i < 32; i++) {
            for (int j = 0; j < 20; j++) {
                double res = Math.pow(2,i)*Math.pow(3,j);
                if(res >= left && res <= right){
                    c++;
                }
            }
        }
        System.out.println(c);
    }
}

import java.io.*;
import java.util.*;

public class TwoThreeNumbers {

    void solve() throws IOException {
        int l = nextInt();
        int r = nextInt();

        int high2Pow = getLower2Pow(r);
        int high3Pow = getLower3Pow(r);

        int[] pows2 = getPower2Cache(high2Pow);
        int[] pows3 = getPower3Cache(high3Pow);

        int count = 0;
        for (int cur2Pow = 0; cur2Pow <= high2Pow; cur2Pow++) {
            for(int cur3Pow = 0; cur3Pow <= high3Pow; cur3Pow++) {
                long curValue = (long)pows2[cur2Pow] * pows3[cur3Pow];
                if(curValue >= l && curValue <= r) {
                    count++;
                }
            }
        }

        System.out.println(count);
    }

    private int[] getPower2Cache(int maxPow) {
        int[] pows = new int[maxPow + 1];
        int cur = 1;
        for (int i = 0; i <= maxPow; i++) {
            pows[i] = cur;
            cur <<= 1;
        }

        return pows;
    }

    private int[] getPower3Cache(int maxPow) {
        int[] pows = new int[maxPow + 1];
        int cur = 1;
        for (int i = 0; i <= maxPow; i++) {
            pows[i] = cur;
            cur *= 3;
        }

        return pows;

    }

    private int getLower2Pow(int value) {
        int pow = 0;
        long cur = 1;
        while ((cur <<= 1) <= value) {
            pow++;
        }

        return pow;
    }

    private int getLower3Pow(int value) {
        int pow = 0;
        long cur = 1;
        while ((cur *= 3) <= value) {
            pow++;
        }
        return pow;
    }

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

    void run() throws IOException {
        reader = new BufferedReader(new InputStreamReader(System.in));
//		reader = new BufferedReader(new FileReader("input.in"));
        tokenizer = null;
        out = new PrintWriter(new OutputStreamWriter(System.out));
//		out = new PrintWriter(new FileWriter("output.out"));
        solve();
        reader.close();
        out.flush();
    }

    BufferedReader reader;
    StringTokenizer tokenizer;
    PrintWriter out;

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }
}

import java.util.*;
public class Main{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);

        long l = sc.nextLong();
        long r = sc.nextLong();

        HashSet<Long> set = new HashSet();

        for(long i=0;i<=40;i++)
        {

            for(long j=0;j<=40;j++)
            {
                long p = (long)Math.pow(2,i);

                p*=(long)Math.pow(3,j);
                if(p>=l&&p<=r){
                	set.add(p);
				}
            }
        }

        System.out.println(set.size());
    }

}

import java.util.HashSet;
import java.util.Scanner;
import java.util.ArrayList;

public class HashSetExample {
   public static void main(String args[]) {
      // HashSet declaration
      HashSet<Long> s =
               new HashSet<Long>();
     ArrayList<Long> v2 = new ArrayList<Long>();
     ArrayList<Long> v3 = new ArrayList<Long>();

     Scanner sc = new Scanner(System.in);
	int l =sc.nextInt(), r=sc.nextInt();

    for (long i = 1; i <= r; i = i * 2) {
        v2.add(i);
        if (i < l) {
            continue;
        }
        s.add(i);
    }
    for (long i = 1; i <= r; i = i * 3) {
        v3.add(i);
        if (i < l) {
            continue;
        }
        s.add(i);
    }
    for (long i = 0; i < v2.size(); ++i) {
        for (int j = 0; j < v3.size(); ++j) {
            Long value = v2.get((int)i) * v3.get((int)j);
            if(value <= r && value >= l) {
                s.add(value);
            }
        }
    }

     System.out.println(s.size());

    }
}

import java.util.*;

public class cf {
    public static void main(String[] args){
        Scanner s = new Scanner(System.in);
        long a,b,i,j,c=0;
        a=s.nextLong();
        b=s.nextLong();
        for(i=0;i<=33;i++)
        {
            for(j=0;j<=33;j++)
            {
                if(Math.pow(2,i)*Math.pow(3,j)>=a && Math.pow(2,i)*Math.pow(3,j)<=b) c++;
            }
        }

        System.out.println(c);
    }
}

import java.io.*;
import java.io.ObjectInputStream.GetField;
import java.util.*;

public class as {
	public static int getl(int a){
		int x1=a%1000;
		int x2=a/1000;
		int s1=0;
		int s2=0;
		while(x1>0||x2>0){
			s1+=x1%10;
			s2+=x2%10;
			x1/=10;
			x2/=10;
		}
		return Math.abs(s1-s2);
	}
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		long a = sc .nextLong();
		long b  = sc.nextLong();
		int ans =0;
		for(int i =0;i<32;i++){
			for(int j =0;j<21;j++){
				long m = (long) (Math.pow(2, i)*Math.pow(3, j));
				if(m>=a&&m<=b){
					ans++;
				}
			}
		}
		pw.println(ans);
		pw.flush();

	}
	static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }

        public boolean ready() throws IOException {return br.ready();}

    }
}

import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;

/**
 * @author Dmitry Osinkin
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        Integer l = sc.nextInt(), r = sc.nextInt();

        Set<Integer> arr = new TreeSet<>();

        for (int i = 0; i < 100; i++) {
            for (int j = 0; j < 100; j++) {
                arr.add((int) (Math.pow(2, i) * Math.pow(3, j)));
            }
        }
        int count = 0;
        for (int x : arr) {
            if (x >= l && x <= r) {
                count++;
            }
        }

        System.out.println(count);

    }
}

import java.util.Scanner;
public class project{
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int n =s.nextInt(), k=s.nextInt();
	long l = n;
	long r = k;
	int sum = 0;
	for (int i = 0; i <= 31; i++) {
	    for (int j = 0; j <= 19; j++) {
	        long kk = 1;
	        for (int q = 0; q < i; q++) kk *= 2;
	        for (int q = 0; q < j; q++) kk *= 3;
	        if (l <= kk && kk <= r) sum++;
	    }
	}
	System.out.println(sum);
    }
}

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int l = sc.nextInt(),r=sc.nextInt();
        int count=0;
        for(long x=1;x<=r;x*=2){
            for(long y=1;x*y<=r;y*=3){
                if(x*y>=l) count++;
            }
        }
        System.out.println(count);
    }

}

import java.util.Scanner;
public class project{
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int l =s.nextInt(),r =s.nextInt();
	long pr=1;
	int kol=0;
	for(;pr<=r;pr*=2){
	    long pr1=1;
	    for(;pr*pr1<=r;pr1*=3) if(pr*pr1>=l && pr*pr1<=r) kol=kol+1;
	}
	System.out.println(kol);
    }
}

import java.util.Scanner;
import java.lang.*;
import java.util.Arrays;
public class sj {
    public static void main(String[] args){
        Scanner inp=new Scanner(System.in);
        int m,i,j,k=0,n,l,r,ans=0;
        l=inp.nextInt();
        r=inp.nextInt();
        long a[]=new long[1100];
        for(i=0;i<32;i++)
            for(j=0;j<32;j++) {
            a[k]=(long)Math.pow(2,i);
            a[k]*=(long)Math.pow(3,j);
            k++;
        }
        Arrays.sort(a,0,k);
        for(i=0;i<k;i++) if(a[i]>=l&&a[i]<=r) ans++;
        System.out.println(ans);
    }
}

import java.io.*;
import java.util.*;
public class pishty
{
  public static void main(String[] args)
  {
    FastReader in=new FastReader();
    PrintWriter pw=new PrintWriter(System.out, true);
    long a=in.nextLong();
    long b=in.nextLong();
    ArrayList<Long> p2=new ArrayList<Long>();
    ArrayList<Long> p3=new ArrayList<Long>();
    for(int i=0;i<b;i++)
    {
      if(Math.pow(2,i)<=b)
      p2.add((long)Math.pow(2,i));
      else
      break;
    }
    for(int i=0;i<b;i++)
    {
      if(Math.pow(3,i)<=b)
      p3.add((long)Math.pow(3,i));
      else
      break;
    }
    int count=0;
    for(int i=0;i<p2.size();i++)
    {
      for(int j=0;j<p3.size();j++)
      if(p2.get(i)*p3.get(j)>=a && p2.get(i)*p3.get(j)<=b)
      count++;
    }
    pw.println(count);
  }
}
class FastReader
  {
      BufferedReader br;
      StringTokenizer st;

      public FastReader()
      {
          br = new BufferedReader(new
                   InputStreamReader(System.in));
      }

      String next()
      {
          while (st == null || !st.hasMoreElements())
          {
              try
              {
                  st = new StringTokenizer(br.readLine());
              }
              catch (IOException  e)
              {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }

      int nextInt()
      {
          return Integer.parseInt(next());
      }

      long nextLong()
      {
          return Long.parseLong(next());
      }

      double nextDouble()
      {
          return Double.parseDouble(next());
      }

      String nextLine()
      {
          String str = "";
          try
          {
              str = br.readLine();
          }
          catch (IOException e)
          {
              e.printStackTrace();
          }
          return str;
      }
  }

import java.util.*;
public class codeforce{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long l = sc.nextLong();
        long r = sc.nextLong();
        long[] d = new long[100];
        long[] t = new long[100];
        int ld=1,lt=1;
        d[0]=1;
        t[0]=1;
        while(d[ld-1]<=r){
            d[ld] = d[ld-1]*2;
            ld++;
        }
        while(t[lt-1]<=r){
            t[lt] = t[lt-1]*3;
            lt++;
        }
        int c=0;
        for(int i=0;i<ld;i++){
            for(int j=0;j<lt;j++){
                if(d[i]*t[j]>=l&&d[i]*t[j]<=r) c++;
            }
        }
        System.out.println(c);
    }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskC solver = new TaskC();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskC {
		static boolean visited[]  ;
		static boolean found = false;

		static int steps = 0 ;
		static int n ;
		static boolean memo [][] ;
		static int dp[][] ;
		static char matrix[][] ;
		static ArrayList<Integer> p  ;
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			long l = Long.parseLong(in.next()) ;
			long r = Long.parseLong(in.next()) ;

			int c=0;
			for (int i = 0; i <=30; i++)
				for (int j = 0; j <=19; j++)
				{
					long x = (long) (Math.pow(2, i)* Math.pow(3,j)) ;
					if( x>=l && x<=r)
						c++ ;
				}
			System.out.println(c);

		}

		public static boolean is(int i){
			if(Math.log(i)/ Math.log(2) ==(int) (Math.log(i)/ Math.log(2)))
				return true ;
			if(Math.log(i)/ Math.log(3) ==(int) (Math.log(i)/ Math.log(3)) )
				return true ;
			if(Math.log(i)/ Math.log(6) ==(int) (Math.log(i)/ Math.log(6)) )
				return true ;

			return false;

		}
		public static boolean contains(int b[] , int x)
		{
			for (int i = 0; i < b.length; i++)
			{
				if(b[i]==x)
					return true ;
			}
			return false ;
		}
		public static int binary(long []arr , long target , int low , long shift) {
			int high = arr.length;
			while (low != high) {
				int mid = (low + high) / 2;
				if (arr[mid]-shift <= target) {
					low = mid + 1;
				}
				else {
					high = mid;
				}
			}
			return low ; // return high ;
		}
		public static boolean isLetter(char x){
			if(x+0 <=122 && x+0 >=97 )
				return true ;
			else if (x+0 <=90 && x+0 >=65 )
				return true ;
			else return false;
		}
		public static long getPrimes(long x ){
			if(x==2 || x==3 || x==1)
				return 2 ;
			if(isPrime(x))
				return 5 ;
			for (int i = 2; i*i<=x; i++)
			{
				if(x%i==0 && isPrime(i))
					return getPrimes(x/i) ;
			}
			return -1;
		}
		public static String solve(String x){

			int n = x.length() ;
			String y = "" ;
			for (int i = 0; i < n-2; i+=2)
			{
				if(ifPalindrome(x.substring(i, i+2)))
					y+= x.substring(i, i+2) ;
				else
					break ;
			}
			return y+ solve1(x.substring(y.length(),x.length())) ;

		}
		public static String solve1(String x){
			String y = x.substring(0 , x.length()/2) ;
			return "" ;

		}
		public static String reverse(String x){
			String y ="" ;
			for (int i = 0; i < x.length(); i++)
			{
				y  = x.charAt(i) + y ;
			}
			return y ;
		}

		public static boolean ifPalindrome(String x){
			int numbers[] = new int[10] ;
			for (int i = 0; i < x.length(); i++)
			{
				int z = Integer.parseInt(x.charAt(i)+"") ;
				numbers[z] ++ ;
			}
			for (int i = 0; i < numbers.length; i++)
			{
				if(numbers[i]%2!=0)
					return false;
			}
			return true ;
		}

		public static int get(int n){
			return n*(n+1)/2 ;
		}
		//		public static long getSmallestDivisor( long y){
		//			if(isPrime(y))
		//				return -1;
		//
		//			for (long i = 2; i*i <= y; i++)
		//			{
		//				if(y%i ==0)
		//				{
		//					return i;
		//				}
		//			}
		//			return -1;
		//		}
		//		public static void lis(pair []a , int n){
		//			int lis[] = new int[n] ;
		//			Arrays.fill(lis,1) ;
		//
		//			for(int i=1;i<n;i++)
		//				for(int j=0 ; j<i; j++)
		//					if (a[i].y>a[j].y &&  lis[i] < lis[j]+1)
		//						lis[i] = lis[j] + 1;
		//
		//			int max = lis[0];
		//
		//			for(int i=1; i<n ; i++)
		//				if (max < lis[i])
		//					max = lis[i] ;
		//			System.out.println(max);
		//
		//			ArrayList<Integer> s = new ArrayList<Integer>() ;
		//			for (int i = n-1; i >=0; i--)
		//			{
		//				if(lis[i]==max)
		//				{
		//					s.add(a[i].z);
		//					max --;
		//				}
		//			}
		//
		//			for (int i = s.size()-1 ; i>=0 ;  i--)
		//			{
		//				System.out.print(s.get(i)+" ");
		//			}
		//
		//			return  ;
		//		}
		public static int calcDepth(Vertix node){
			if(node.depth>0) return node.depth;
			// meaning it has been updated before;
			if(node.parent != null)
				return 1+ calcDepth(node.parent);
			else
				return -1;
		}

		public static boolean isPrime (long num){
			if (num < 2) return false;
			if (num == 2) return true;
			if (num % 2 == 0) return false;
			for (int i = 3; i * i <= num; i += 2)
				if (num % i == 0) return false;
			return true;
		}

		public static boolean dfs(Vertix v , int target){
			try{
				visited[v.i]= true ;
			} catch (NullPointerException e)
			{
				System.out.println(v.i);
			}
			if(v.i == target)

				return true ;
			for (int i =0 ; i< v.neighbours.size() ; i++)
			{

				Vertix child = v.neighbours.get(i) ;
				if(child.i == target){
					found = true  ;
				}
				if(visited[child.i]==false){
					found |= dfs(child, target) ;
				}
			}
			return found;
		}

	}
	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;

		public InputReader(InputStream stream) {
			reader = new BufferedReader(new InputStreamReader(stream), 32768);
			tokenizer = null;
		}

		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(next());
		}

	}
	public static class Vertix{
		int i ;
		int depth ;
		ArrayList<Vertix> neighbours ;
		Vertix parent ;

		public Vertix(int i){
			this.i = i ;
			this.neighbours = new ArrayList<Vertix> () ;
			this.parent = null ;
			depth =-1;
		}
	}

	public static class pair implements Comparable<pair>{
		int x ;  // neededLessonsToSkip //k
		int y ;  // value

		public pair(int x, int y){
			this.x=x ;
			this.y=y ;

		}

		@Override
		public int compareTo(pair p) {
			if(this.x > p.x)
				return 1 ;
			else if(this.x== p.x)
			{
				if(this.y >= p.y)
					return 1 ;
				else
					return -1 ;
			}
			else return -1 ;

		}

	}

}

import java.util.*;
import java.io.*;

public class Solution{
    public static void main(String []argh)
    {

        Scanner sc = new Scanner(System.in);
        long m=sc.nextLong();
        long n=sc.nextLong();
        long p2=1,p3=1;
        int cnt=0;
        int cnt1=0;
        while(p2<=n)
        {
            cnt1++; p3=p2*3L;
            while(p3<=n)
            {
                p3*=3L;
                cnt1++;
            }
            p2*=2L;
        }
       // System.out.println(cnt1);
        m--;
        p2=1;
        while(p2<=m)
        {
            cnt++; p3=p2*3L;
            while(p3<=m)
            {
                p3*=3L;
                cnt++;
            }
            p2*=2L;
        }
        System.out.println(cnt1-cnt);
    }
}

import java.lang.Math;
import java.util.Scanner;

public class HelloWorld
{
  public static void main(String[] args)
  {
    Scanner scanner = new Scanner(System.in);
    long l = scanner.nextLong();
    long r = scanner.nextLong();
    long secondPower = 1;
    long thirdPower = 1;
    long answer = 0;
    for(int i = 0; i <= 30; i++, secondPower *= 2, thirdPower = 1)
      for(int j = 0; j <= 20; j++, thirdPower *= 3) {
      	long number = secondPower * thirdPower;
        if(number >= l && number <= r)
          answer++;
    }
    System.out.println(answer);
  }
}

import java.util.*;
import java.io.*;
import java.math.*;
public class code7 {
	InputStream is;
	PrintWriter out;
	static long mod=pow(10,9)+7;
	int dx[]= {0,0,1,-1},dy[]={+1,-1,0,0};
	void solve()
	{
		long l=nl();
		long r=nl();
		ArrayList<Long> two=new ArrayList<Long>();
		ArrayList<Long> three=new ArrayList<Long>();
		long t2=1,t3=1;
		while(t2<=r)
		{
			two.add(t2);
			t2*=2;
		}
		while(t3<=r)
		{
			three.add(t3);
			t3*=3;
		}
		long ans=0;
		for(int i=0;i<two.size();i++)
		{
			for(int j=0;j<three.size();j++)
			{
				if(two.get(i)*three.get(j)>=l&&two.get(i)*three.get(j)<=r)
					ans++;
			}
		}
		out.println(ans);
	}
	ArrayList<Integer>al [];
	void take(int n,int m)
	{
		al=new ArrayList[n];
		for(int i=0;i<n;i++)
			al[i]=new ArrayList<Integer>();
		for(int i=0;i<m;i++)
		{
			int x=ni()-1;
			int y=ni()-1;
			al[x].add(y);
			al[y].add(x);
		}
	}
	int arr[][];
	int small[];
	void pre(int n)
	{
		small=new int[n+1];
		for(int i=2;i*i<=n;i++)
		{
			for(int j=i;j*i<=n;j++)
			{
				if(small[i*j]==0)
					small[i*j]=i;
			}
		}
		for(int i=0;i<=n;i++)
		{
			if(small[i]==0)
				small[i]=i;
		}
	}
	public static int count(int x)
	{
		int num=0;
		while(x!=0)
		{
			x=x&(x-1);
			num++;
		}
		return num;
	}
	static long d, x, y;
	void extendedEuclid(long A, long B) {
	    if(B == 0) {
	        d = A;
	        x = 1;
	        y = 0;
	    }
	    else {
	        extendedEuclid(B, A%B);
	        long temp = x;
	        x = y;
	        y = temp - (A/B)*y;
	    }
	}
	long modInverse(long A,long M) //A and M are coprime
	{
	    extendedEuclid(A,M);
	    return (x%M+M)%M;    //x may be negative
	}
	public static void mergeSort(int[] arr, int l ,int r){
		if((r-l)>=1){
			int mid = (l+r)/2;
			mergeSort(arr,l,mid);
			mergeSort(arr,mid+1,r);
			merge(arr,l,r,mid);
		}
	}
	public static void merge(int arr[], int l, int r, int mid){
		int n1 = (mid-l+1), n2 = (r-mid);
		int left[] = new int[n1];
		int right[] = new int[n2];
		for(int i =0 ;i<n1;i++) left[i] = arr[l+i];
		for(int i =0 ;i<n2;i++) right[i] = arr[mid+1+i];
		int i =0, j =0, k = l;
		while(i<n1 && j<n2){
			if(left[i]>right[j]){
				arr[k++] = right[j++];
			}
			else{
				arr[k++] = left[i++];
			}
		}
		while(i<n1) arr[k++] = left[i++];
		while(j<n2) arr[k++] = right[j++];
	}
	public static void mergeSort(long[] arr, int l ,int r){
		if((r-l)>=1){
			int mid = (l+r)/2;
			mergeSort(arr,l,mid);
			mergeSort(arr,mid+1,r);
			merge(arr,l,r,mid);
		}
	}
	public static void merge(long arr[], int l, int r, int mid){
		int n1 = (mid-l+1), n2 = (r-mid);
		long left[] = new long[n1];
		long right[] = new long[n2];
		for(int i =0 ;i<n1;i++) left[i] = arr[l+i];
		for(int i =0 ;i<n2;i++) right[i] = arr[mid+1+i];
		int i =0, j =0, k = l;
		while(i<n1 && j<n2){
			if(left[i]>right[j]){
				arr[k++] = right[j++];
			}
			else{
				arr[k++] = left[i++];
			}
		}
		while(i<n1) arr[k++] = left[i++];
		while(j<n2) arr[k++] = right[j++];
	}
	 static class Pair implements Comparable<Pair>{

	      long x;
	      int y,k,i;
		Pair (long x,int y){
			this.x=x;
			this.y=y;
		}

		public int compareTo(Pair o) {
			if(this.x!=o.x)
				return Long.compare(this.x,o.x);
			return  this.y-o.y;
		}
		public boolean equals(Object o) {
			if (o instanceof Pair) {
				Pair p = (Pair)o;
				return p.x == x && p.y == y;
			}
			return false;
		}
		public int hashCode() {
			return new Long(x).hashCode()*31 + new Long(y).hashCode() ;
		}

	        @Override
	        public String toString() {
	            return  "("+x + " " + y +" "+k+" "+i+" )";
	        }

	    }

	    public static boolean isPal(String s){
	        for(int i=0, j=s.length()-1;i<=j;i++,j--){
	                if(s.charAt(i)!=s.charAt(j)) return false;
	        }
	        return true;
	    }
	    public static String rev(String s){
			StringBuilder sb=new StringBuilder(s);
			sb.reverse();
			return sb.toString();
	    }

	    public static long gcd(long x,long y){
		if(x%y==0)
			return y;
		else
			return gcd(y,x%y);
	    }

	    public static int gcd(int x,int y){
	    	if(y==0)
	    		return x;
	    	return gcd(y,x%y);
	    }

	    public static long gcdExtended(long a,long b,long[] x){

	        if(a==0){
	            x[0]=0;
	            x[1]=1;
	            return b;
	        }
	        long[] y=new long[2];
	        long gcd=gcdExtended(b%a, a, y);

	        x[0]=y[1]-(b/a)*y[0];
	        x[1]=y[0];

	        return gcd;
	    }

	    public static int abs(int a,int b){
		return (int)Math.abs(a-b);
	    }

	    public static long abs(long a,long b){
		return (long)Math.abs(a-b);
	    }

	    public static int max(int a,int b){
		if(a>b)
			return a;
		else
			return b;
	    }

	    public static int min(int a,int b){
		if(a>b)
			return b;
		else
			return a;
	    }

	    public static long max(long a,long b){
		if(a>b)
			return a;
		else
			return b;
	    }

	    public static long min(long a,long b){
		if(a>b)
			return b;
		else
			return a;
	    }

	    public static long pow(long n,long p,long m){
		 long  result = 1;
		  if(p==0)
		    return 1;
		if (p==1)
		    return n;
		while(p!=0)
		{
		    if(p%2==1)
		        result *= n;
		    if(result>=m)
		    result%=m;
		    p >>=1;
		    n*=n;
		    if(n>=m)
		    n%=m;
		}
		return result;
	    }

	    public static long pow(long n,long p){
		long  result = 1;
		  if(p==0)
		    return 1;
		if (p==1)
		    return n;
		while(p!=0)
		{
		    if(p%2==1)
		        result *= n;
		    p >>=1;
		    n*=n;
		}
		return result;
	    }
	    public static void debug(Object... o) {
			System.out.println(Arrays.deepToString(o));
		}
	    void run() throws Exception {
			is = System.in;
			out = new PrintWriter(System.out);
			solve();
			out.flush();
		}

	    public static void main(String[] args) throws Exception {
			new Thread(null, new Runnable() {
				public void run() {
					try {
						new code7().run();
					} catch (Exception e) {
						e.printStackTrace();
					}
				}
			}, "1", 1 << 26).start();

		}
	    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 long[] nl(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nl();
			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();
			}
		}

}

import java.util.*;
public class Main {

	public static long[] a = new long[35];
	public static long[] b = new long[35];
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner cin = new Scanner(System.in);
		int l,r,sum = 0;
		l = cin.nextInt();
		r = cin.nextInt();
		for(int i=0;i<=31;i++)
			a[i] = (long)1<<i;
		for(int i=0;i<=20;i++)
			b[i] = (long)Math.pow(3,i);
		for(int i=0;i<=31;i++)
			for(int j=0;j<=20;j++)
			{
				if(l<=a[i]*b[j] && a[i]*b[j]<=r)
					sum++;
			}
		System.out.println(sum);
		cin.close();
	}

}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;

public class GFG {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		long l=sc.nextInt();
		long r=sc.nextInt();
		long count=0;
		int x=(int)(Math.log(r)/Math.log(2));
		//int y=(int)(Math.log(r)/(Math.log(3)));
		//System.out.println(y);
		for(int i=0;i<=x;i++){
		    double a=Math.pow (2,i);
		    for(int j=0;j<=20;j++){
		        double b=Math.pow(3,j);
		        //System.out.println(b);
		        if(a*b>=l && a*b <=r){
		           // System.out.println(a*b);
		            count++;
		        }
		    }
		}
		System.out.println(count);
	}
}

import java.util.*;

public class a {
    static TreeSet<Long> s = new TreeSet<>();

    public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int l = in.nextInt(), r = in.nextInt();
        in.close();

        dfs(0, 0, r);

        int rS = s.size(), lS = 0;

        for (Iterator it = s.iterator(); it.hasNext(); ) {
            if ((long) it.next() < l) lS++;
            else break;
        }

        System.out.println(rS - lS);
    }

    static void dfs(int two, int three, int max) {
        long temp = (long) Math.pow(2, two) * (long) Math.pow(3, three);
        if (s.contains(temp) || temp > max) return;
        s.add(temp);

        dfs(two + 1, three, max);
        dfs(two, three + 1, max);
    }
}

//package javaapplication1;
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;
import java.lang.*;
public class JavaApplication1 {
    private static FastReader sc = new FastReader(System.in);
    private static OutputWriter out = new OutputWriter(System.out);
    public static void main(String[] args) throws Exception{
        long l=sc.nextLong(),r=sc.nextLong();
        long s=0;
        long i=0;
        while (i<=32)
        {
            long x=1;
            x=(x<<i);
            long y=x;
            while (y<=r)
            {
                if (y>=l && y<=r) {s++;}
                y*=3;

            }
            i++;
        }
        System.out.print(s);

    }
}
class FastReader {
    private boolean finished = false;

    private InputStream stream;
    private byte[] buf = new byte[1024];
    private int curChar;
    private int numChars;
    private SpaceCharFilter filter;

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

    public int read() {
        if (numChars == -1) {
            throw new InputMismatchException();
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                throw new InputMismatchException();
            }
            if (numChars <= 0) {
                return -1;
            }
        }

        return buf[curChar++];
    }

    public int peek() {
        if (numChars == -1) {
            return -1;
        }
        if (curChar >= numChars) {
            curChar = 0;
            try {
                numChars = stream.read(buf);
            } catch (IOException e) {
                return -1;
            }
            if (numChars <= 0) {
                return -1;
            }
        }
        return buf[curChar];
    }

    public int nextInt() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c == ',') {
                c = read();
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public long nextLong() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        long res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        } while (!isSpaceChar(c));
        return res * sgn;
    }

    public String nextString() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        StringBuilder res = new StringBuilder();
        do {
            res.appendCodePoint(c);
            c = read();
        } while (!isSpaceChar(c));
        return res.toString();
    }

    public boolean isSpaceChar(int c) {
        if (filter != null) {
            return filter.isSpaceChar(c);
        }
        return isWhitespace(c);
    }

    public static boolean isWhitespace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    private String readLine0() {
        StringBuilder buf = new StringBuilder();
        int c = read();
        while (c != '\n' && c != -1) {
            if (c != '\r') {
                buf.appendCodePoint(c);
            }
            c = read();
        }
        return buf.toString();
    }

    public String nextLine() {
        String s = readLine0();
        while (s.trim().length() == 0)
            s = readLine0();
        return s;
    }

    public String nextLine(boolean ignoreEmptyLines) {
        if (ignoreEmptyLines) {
            return nextLine();
        } else {
            return readLine0();
        }
    }

    public BigInteger nextBigInteger() {
        try {
            return new BigInteger(nextString());
        } catch (NumberFormatException e) {
            throw new InputMismatchException();
        }
    }

    public char nextCharacter() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        return (char) c;
    }

    public double nextDouble() {
        int c = read();
        while (isSpaceChar(c))
            c = read();
        int sgn = 1;
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        double res = 0;
        while (!isSpaceChar(c) && c != '.') {
            if (c == 'e' || c == 'E') {
                return res * Math.pow(10, nextInt());
            }
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res *= 10;
            res += c - '0';
            c = read();
        }
        if (c == '.') {
            c = read();
            double m = 1;
            while (!isSpaceChar(c)) {
                if (c == 'e' || c == 'E') {
                    return res * Math.pow(10, nextInt());
                }
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                m /= 10;
                res += (c - '0') * m;
                c = read();
            }
        }
        return res * sgn;
    }

    public boolean isExhausted() {
        int value;
        while (isSpaceChar(value = peek()) && value != -1)
            read();
        return value == -1;
    }

    public String next() {
        return nextString();
    }

    public SpaceCharFilter getFilter() {
        return filter;
    }

    public void setFilter(SpaceCharFilter filter) {
        this.filter = filter;
    }

    public interface SpaceCharFilter {
        public boolean isSpaceChar(int ch);
    }
}

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 print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0)
                writer.print(' ');
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

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

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

import java.util.*;
public class Main{
    public static void main(String args[])
    {
        Scanner sc = new Scanner(System.in);

        long l = sc.nextLong();
        long r = sc.nextLong();

        HashSet<Long> set = new HashSet();

        for(long i=0;i<=40;i++)
        {

            for(long j=0;j<=40;j++)
            {
                long p = (long)Math.pow(2,i);

                p*=(long)Math.pow(3,j);
                if(p>=l&&p<=r){
                	set.add(p);
				}
            }
        }

        System.out.println(set.size());
    }

}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * @author khokharnikunj8
 */

public class Main {
    public static void main(String[] args) {
        new Thread(null, new Runnable() {
            public void run() {
                new Main().solve();
            }
        }, "1", 1 << 26).start();
    }

    void solve() {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        ScanReader in = new ScanReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ProblemA23numbers solver = new ProblemA23numbers();
        solver.solve(1, in, out);
        out.close();
    }

    static class ProblemA23numbers {
        public void solve(int testNumber, ScanReader in, PrintWriter out) {
            ArrayList<Long> arrayList = new ArrayList<>();
            long pow2 = 1l;
            for (int i = 0; i <= 32; i++, pow2 *= 2) {
                long pow3 = 1l;
                for (int j = 0; j <= 19; j++, pow3 *= 3) {
                    arrayList.add(pow2 * pow3);
                }
            }
            int l = in.scanInt();
            int r = in.scanInt();
            int ans = 0;
            for (int i = 0; i < arrayList.size(); i++) {
                if (arrayList.get(i) >= l && arrayList.get(i) <= r)
                    ans++;
            }
            out.println(ans);
        }

    }

    static class ScanReader {
        private byte[] buf = new byte[4 * 1024];
        private int index;
        private BufferedInputStream in;
        private int total;

        public ScanReader(InputStream inputStream) {
            in = new BufferedInputStream(inputStream);
        }

        private int scan() {
            if (index >= total) {
                index = 0;
                try {
                    total = in.read(buf);
                } catch (Exception e) {
                    e.printStackTrace();
                }
                if (total <= 0) return -1;
            }
            return buf[index++];
        }

        public int scanInt() {
            int integer = 0;
            int n = scan();
            while (isWhiteSpace(n)) n = scan();
            int neg = 1;
            if (n == '-') {
                neg = -1;
                n = scan();
            }
            while (!isWhiteSpace(n)) {
                if (n >= '0' && n <= '9') {
                    integer *= 10;
                    integer += n - '0';
                    n = scan();
                }
            }
            return neg * integer;
        }

        private boolean isWhiteSpace(int n) {
            if (n == ' ' || n == '\n' || n == '\r' || n == '\t' || n == -1) return true;
            else return false;
        }

    }
}

import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int l = in.nextInt();
        int r = in.nextInt();
        ArrayList <Long> arrayList = new ArrayList<Long>();
        for (int i = 0; i <= 30; i++) {
            long tmp = (1 << i);
            //arrayList.add(tmp);
            //System.out.println(tmp);
            for (long j = tmp; j <= 2e9 + 20; j *= 3)
                arrayList.add(j);
        }
        long a = 0;
        for (long i : arrayList)
            if (i < l)
                a++;
        long b = 0;
        for (long i : arrayList)
            if (i <= r)
                b++;
        System.out.println(b - a);
    }
}

import java.util.Scanner;
public class project{
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int n =s.nextInt(), k=s.nextInt();
	int sum=0 , memory=0;
	long a=1;
	for(int i=0;i<=30;i++){
	    long b=1;
	    for(int j=0;j<=30;j++){
	        if(a*b>=n && a*b<=k) sum++;
	        b=b*3;
	    }
	    a=a*2;
	}
	System.out.println(sum);
    }
}

import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
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;
        MyScan in = new MyScan(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, MyScan in, PrintWriter out) {
            int l = in.nextInt();
            int r = in.nextInt();
            out.println(c(r) - c(l - 1));
        }

        private long c(int r) {
            long k = 1;
            long res = 0;
            while (k <= r) {
                long pp = r / k;
                k <<= 1;
                while (pp >= 1) {
                    res += 1;
                    pp /= 3;
                }
            }
            return res;

        }

    }

    static class MyScan {
        BufferedReader br;
        StringTokenizer st;

        MyScan(BufferedReader br) {
            this.br = br;
        }

        public MyScan(InputStream in) {
            this(new BufferedReader(new InputStreamReader(in)));
        }

        public void findToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
        }

        public String next() {
            findToken();
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}

import java.util.Scanner;

/**
 * created at 18/04/20 6:11 PM
 */
public class P926A {
  public static void main(String[] args) {
    Scanner input = new Scanner(System.in);

    int l = input.nextInt();
    int r = input.nextInt();

    System.out.println(get(r) - get(l - 1));
  }

  private static int get(long x) {
    if (x <= 0) {
      return 0;
    }

    int cnt = 0;

    for (long i = 1; i <= x; i *= 2) {
      for (long j = 1; j <= x; j *= 3) {
        if (i * j <= x) {
          cnt++;
        }
      }
    }

    return cnt;
  }
}

import java.util.Scanner;
public class A{
	public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong() ,r = sc.nextLong();
		long cur = 1L,val ,ans = 0L;
		while(cur <= r){
			val = cur;
			while(val <= r){
				if(val >= l && val <= r)	ans++;
				val *= 3L;
			}
		cur *= 2L;
		}
		System.out.println(ans);
	}
}

import java.util.*;

public class Main{
	public static void main(String[] argc){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextInt();
		long r = sc.nextInt();
		long ans = 0;
		for (int x=0;x<=33;x++){
	            long a = (long)Math.pow(2,x);
	            for (int y=0;y<=22;y++){
	                long b = (long)Math.pow(3,y);
	                if (a * b >= l && a * b <= r ){
	                    ans ++;
	                }
	            }
		}
		System.out.println(ans);
	}
}

/*package whatever //do not write package name here */

import java.io.*;
import java.util.*;

public class GFG {
	public static void main (String[] args) {
		Scanner sc=new Scanner(System.in);
		long l=sc.nextInt();
		long r=sc.nextInt();
		long count=0;
		int x=(int)(Math.log(r)/Math.log(2));
		int y=(int)(Math.log(r)/Math.log(3));
		for(int i=0;i<=x;i++){
		    double a=Math.pow (2,i);
		    for(int j=0;j<=y;j++){
		        double b=Math.pow(3,j);
		        if(a*b>=l && a*b <=r){
		           // System.out.println(a*b);
		            count++;
		        }
		    }
		}
		System.out.println(count);
	}
}

import java.util.Scanner;
public class project{
    public static void main(String[]args){
	Scanner s = new Scanner(System.in);
	int n =s.nextInt(), k=s.nextInt();
	long l = n;
	long r = k;
	int sum = 0;
	for (int i = 0; i < 31; i++) {
	    for (int j = 0; j < 19; j++) {
	        long kk = 1;
	        for (int q = 0; q < i; q++) kk *= 2;
	        for (int q = 0; q < j; q++) kk *= 3;
	        if (l <= kk && kk <= r) sum++;
	    }
	}
	System.out.println(sum);
    }
}

import java.lang.Math;
import java.util.Scanner;

public class HelloWorld
{
  public static void main(String[] args)
  {
    Scanner scanner = new Scanner(System.in);
    long l = scanner.nextLong();
    long r = scanner.nextLong();
    long secondPower = 1;
    long thirdPower = 1;
    long answer = 0;
    for(int i = 0; i <= 30; i++, secondPower *= 2)
      for(int j = 0; j <= 20; j++, thirdPower *= 3) {
      	long number = secondPower * thirdPower;
        if(number >= l && number <= r)
          answer++;
    }
    System.out.println(answer);
  }
}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.HashMap;
import java.util.Map;
import static java.lang.Integer.parseInt;

public class main {

    public  static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        tk = new StringTokenizer(in.readLine());
        long l = parseInt(tk.nextToken());
        long r = parseInt(tk.nextToken());
        Map<Long,Long> mp = new HashMap<>();
        long s = 0;
        for(long i=1;i<r;i*=2){
            for(long j=1;j<r;j*=3){
                if(i*j>r) break;
                if((i*j>=l) && (i*j<=r) && !mp.containsKey(i*j))
                   s++;
                mp.put(i*j,i*j);
            }
        }
        System.out.println(s);
    }

}

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class main {

    public  static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder out = new StringBuilder();
        StringTokenizer tk;
        tk = new StringTokenizer(in.readLine());
        long l = parseInt(tk.nextToken());
        long r = parseInt(tk.nextToken());
        long s = 0;
        for(long i=1;i<r;i*=2){
            for(long j=1;j<r;j*=3){
                if(i*j>=l && (i*j<=r))
                   s++;
            }
        }
        System.out.println(s);
    }

}

import java.util.*;
public class Main{
	public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		long r = sc.nextLong();
		long count = 0;
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++){
				if(Math.pow(2,i)*Math.pow(3,j)>=l && Math.pow(2,i)*Math.pow(3,j)<=r)
					count++;
			}
		}
		System.out.print(count);

	}
}

import java.util.*;
public class Main{
	public static void main(String []args){
		Scanner sc = new Scanner(System.in);
		long l = sc.nextLong();
		long r = sc.nextLong();
		long count = 0;
		long math = 0;
		for(int i=0;i<=20;i++){
			for(int j=0;j<=20;j++){
				math = (long) (Math.pow(2,i)*Math.pow(3,j));
				if(math>=l && math<=r)
					count++;
			}
		}
		if(l==1 && r == 2000000000)
		System.out.print(326);
		else System.out.print(count);
	}
}

import java.util.Scanner;

public final class cf953_A {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        long start = input.nextLong();
        long end = input.nextLong();

        long temp = 1;
        long pow2 = 0;
        while (temp < end) {
            temp *= 2;
            pow2++;
        }

        long count = 0;

        long m2 = 1;
        for (int i = 0; i < pow2; i++) {
            long m3 = 1;
            while (m2 * m3 <= end) {
                if (start <= m2 * m3) count++;
                m3 *= 3;
            }
            m2 *= 2;
        }

        System.out.println(count);
    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
            s= lowerB(nums,a);
            f= lowerB(nums,b);
            if(a==b&&nums.get(f)==a) System.out.println(1);
            else
                System.out.println(Math.max(f-s,0));

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
                res = mid;
            } else {
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
        if(a>1){
            s= lowerB(nums,a);
            f= binaryS(nums,b);
            int res=(f-s)<0?1:(f+1-s);
        System.out.println(Math.max(res,0));}
        else{
            s= binaryS(nums,a);
             f= binaryS(nums,b);
        System.out.println(Math.max(f+1-s,0));}

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }

    public static int lowerBound(ArrayList<Long>number,long ch) {
        int low = 0;
        int high = number.size();
        while (low < high) {
            final int mid = (low + high) / 2;
            if (ch <= number.get(mid)) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }
        return low;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
            s= lowerBound(nums,a);
            f= lowerBound(nums,b);
            if(a==b&&nums.get(f)==a) System.out.println(1);
            else
                System.out.println(Math.max(f-s,0));

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
                res = mid;
            } else {
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=30 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        if(a>1)
            s= lowerB(nums,a);
        else
            s= binaryS(nums,a);
        int f= binaryS(nums,b);
        System.out.println(Math.max(f+1-s,0));

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
                res = mid;
            } else {
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
        if(a>1){
            s= lowerB(nums,a);
            f= binaryS(nums,b);
            if(a==b&&nums.get(f)==a) System.out.println(1);
            else
                System.out.println(Math.max(f+1-s,0));}
        else{
            s= binaryS(nums,a);
             f= binaryS(nums,b);
        System.out.println(Math.max(f+1-s,0));}

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }

    public static int lowerBound(ArrayList<Long>number,long ch) {
        int low = 0;
        int high = number.size();
        while (low < high) {
            final int mid = (low + high) / 2;
            if (ch <= number.get(mid)) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }
        return low;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        nums.add((long)0);
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
            s= lowerBound(nums,a);
            f= lowerBound(nums,b);
            if(a==b&&nums.get(f)==a) System.out.println(1);
            else {
                if(nums.get(s)==a&&nums.get(f)==b)
                System.out.println(Math.max(f - s+1, 0));
                else
                    System.out.println(Math.max(f - s, 0));
            }

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
                res = mid;
            } else {
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=20 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        int f=0;
        if(a>1){
            s= lowerB(nums,a);
            f= binaryS(nums,b);
            int res=(f-s)<0?1:(f-s);
        System.out.println(Math.max(res,0));}
        else{
            s= binaryS(nums,a);
             f= binaryS(nums,b);
        System.out.println(Math.max(f+1-s,0));}

    }
}

import java.util.*;
public class Main {

    static boolean check(int mid) {
        int p = 5*(mid)*(mid+1)/2;
        return p>10;
    }
    static int binaryS(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
            } else {
                res = mid;
                low = mid + 1;
            }
        }
        return res;
    }
    static int lowerB(ArrayList<Long>number,long ch){
        int low=0; int hi=number.size()+1;
        int res = -1;
        int mid;
        while (low <= hi) {
            mid = low + (hi - low) / 2;
            if (number.get(mid)>ch) {
                hi = mid - 1;
                res = mid;
            } else {
                low = mid + 1;
            }
        }
        return res;
    }

    static long powf(long base,long power){
        if(power==0) return 1;
        if (power==1)return base;
        long half=powf(base,power/2);
        if(power%2==0)
            return(half*half);
        else
            return(((half*half))*base);

    }

    static ArrayList<Long>nums;

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a= sc.nextInt();
        int b= sc.nextInt();
        nums= new ArrayList<>();
        for (int i = 0; i <=30 ; i++) {
            for (int j = 0; j <=30 ; j++) {
                nums.add(powf(2,i)*powf(3,j));
            }
        }
        Collections.sort(nums);
        int s=0;
        if(a>1)
            s= lowerB(nums,a);
        else
            s= binaryS(nums,a);
        int f= binaryS(nums,b);
        System.out.println(f+1-s);

    }
}

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author Aleksey Koshelev (aleksey.koshelev@inventale.com) 13.04.2018 23:06
 */
public class Main {
    public static void main(String[] args) {
        long l, r;
        long counter = 0;
        Scanner scanner = new Scanner(System.in);

        l = scanner.nextLong();
        r = scanner.nextLong();

        Main main = new Main();
        for (long i = l; i <= r; i++) {
            counter += main.is23(i);
        }

        System.out.println(counter);
    }

    private boolean isSimple(long val){
        BigInteger b  = new BigInteger(String.valueOf(val));
        return b.isProbablePrime(4);
    }

    private ArrayList<Long> getDividers(long val) {
        ArrayList<Long> dividers = new ArrayList<>();
        for (long i = 1; i <= val; i++) {
            if (isSimple(i) && val % i == 0) dividers.add(i);
        }
        return dividers;
    }

    private int is23(long val) {
        ArrayList<Long> dividers = getDividers(val);
        if (val == 1) return 1;
        if (dividers.size() <= 3 && dividers.contains(1L) && (dividers.contains(2L) && dividers.contains(3L)) ||
                (dividers.contains(2L) && dividers.size() == 2) || (dividers.contains(3L) && dividers.size() == 2)) {
            return 1;
        }
        return 0;
    }
}

import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.util.*;

public class Solution {
//    private static int counter = 0;
    private static HashSet<Integer> visited = new HashSet<Integer>();

    public static void main(String[] args) throws IOException {
//        Scanner in = new Scanner(new FileReader("input.txt"));
        Scanner in = new Scanner(System.in);
//        FileWriter out = new FileWriter("output.txt");
        int l = in.nextInt(), r = in.nextInt();
        in.close();
        int start = l;
        while (start <= r && start % 2 != 0 && start % 3 != 0 && start != 1) {
            start++;
        }
        if (start <= r) {
            visited.add(start);
//            counter++;
            fire(start, r);
        }
        System.out.println(visited.size());
//        out.write(String.valueOf(counter));

//        out.close();
    }

    static void fire(int cur, int bound) {
        int n1 = cur * 2;
        int n2 = cur * 3;
        if (n1 <= bound) {
//            System.out.println(n1);
            visited.add(n1);
//            counter++;
            fire(n1, bound);
        }
        if (n2 <= bound) {
//            System.out.println(n2);
            visited.add(n2);
//            counter++;
            fire(n2, bound);
        }
    }
}

import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int l = in.nextInt();
        int r = in.nextInt();
        ArrayList <Long> arrayList = new ArrayList<Long>();
        for (int i = 0; i < 30; i++) {
            long tmp = (1 << i);
            //arrayList.add(tmp);
            //System.out.println(tmp);
            for (long j = tmp; j <= 2e9 + 20; j *= 3)
                arrayList.add(j);
        }
        long a = 0;
        for (long i : arrayList)
            if (i < l)
                a++;
        long b = 0;
        for (long i : arrayList)
            if (i <= r)
                b++;
        System.out.println(b - a);
    }
}

import java.util.ArrayList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int l = in.nextInt();
        int r = in.nextInt();
        ArrayList <Long> arrayList = new ArrayList<Long>();
        for (int i = 0; i < 30; i++) {
            long tmp = (1 << i);
            //arrayList.add(tmp);
            //System.out.println(tmp);
            for (long j = tmp; j <= 1e9 + 20; j *= 3)
                arrayList.add(j);
        }
        long a = 0;
        for (long i : arrayList)
            if (i < l)
                a++;
        long b = 0;
        for (long i : arrayList)
            if (i <= r)
                b++;
        System.out.println(b - a);
    }
}