/* package whatever; // don't place package name! */

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

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	static int count(int start, int end) {
		start = Math.max(start, 1);

		int count = 0;
		int p = 1;
		while (p <= end) {
		  if (p >= start) ++count;
		
		  if (p > Integer.MAX_VALUE / 3) break;
		
		  p *= 3;
		}
		return count;
	}
	
	public static void main (String[] args) throws java.lang.Exception
	{
		// Perfunctory warm-up
		Random r = new Random();
		for (int i = 0; i < 10_000; ++i) {
			int start = r.nextInt();
			int end = r.nextInt();
			if (end < start) {
				int tmp = start;
				start = end;
				end = start;
			}
			count(start, end);
		}
		
		long start = System.nanoTime();
		count(1, Integer.MAX_VALUE);
		long end = System.nanoTime();
		
		System.out.println((end - start) / 1e9);
	}
}