A non-empty string s is called binary, if it consists only of characters "0" and "1". Let's number the characters of binary string s from 1 to the string's length and let's denote the i-th character in string s as si.

Binary string s with length n is periodical, if there is an integer 1 ≤ k < n such that: 

  * k is a divisor of number n
  * for all 1 ≤ i ≤ n - k, the following condition fulfills: si = si + k



For example, binary strings "101010" and "11" are periodical and "10" and "10010" are not.

A positive integer x is periodical, if its binary representation (without leading zeroes) is a periodic string.

Your task is to calculate, how many periodic numbers are in the interval from l to r (both ends are included).

Input

The single input line contains two integers l and r (1 ≤ l ≤ r ≤ 1018). The numbers are separated by a space.

Please, do not use the %lld specifier to read or write 64-bit integers in С++. It is preferred to use the cin, cout streams or the %I64d specifier.

Output

Print a single integer, showing how many periodic numbers are in the interval from l to r (both ends are included).

Examples

Input

1 10


Output

3


Input

25 38


Output

2

Note

In the first sample periodic numbers are 3, 7 and 10.

In the second sample periodic numbers are 31 and 36.
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class E {
	public static void main(String[] args) throws IOException {
		new E().run();
	}
	
	Map<Integer, Long> shortLen = new HashMap<Integer, Long>();
	
	public long _solveLen(int len) {
		if (len < 2) {
			return 0;
		}
		long result = 0;
		for (int i = 1; i <= len / 2; ++i) {
			if (len % i == 0) {
				result += (1 << (i - 1)) - solveLen(i);
			}
		}
		return result;
	}
	
	public long solveLen(int len) {
		if (shortLen.containsKey(len)) {
			return shortLen.get(len);
		}
		long result = _solveLen(len);
		shortLen.put(len, result);
		return result;
	}

	int[] bits;
	
	public boolean check(int n, int len) {
		for (int i = 1; i <= len / 2; ++i) {
			if (len % i == 0) {
				for (int j = 0; j < len; ++j) {
					if (bits[n - j - 1] != bits[n - j % i - 1]) {
						return true;
					}
				}
				return false;
			}
		}
		return true;
	}
	
	public long _solveHard(int n, int len, int fixed) {
		if (fixed == len) {
			if (!check(n, len)) {
				return 0;
			}
			// just check
			for (int i = n - 1 - len; i >= 0; --i) {
				int j = n - 1 - i;
				if (bits[i] != bits[n - 1 - j % len]) {
					return bits[i] > bits[n - 1 - j % len] ? 1 : 0;
				}
			}
			return 1;
		}
		if (bits[n - 1 - fixed] != 1) {
			return 0;
		}
		long result = (1 << (len - fixed - 1));
		bits[n - 1 - fixed] = 0; 
		for (int i = 1; i <= fixed; ++i) {
			if (len % i == 0) {
				boolean match = true;
				for (int j = 0; j <= fixed; ++j) {
					int k = n - 1 - j;
					if (bits[k] != bits[n - 1 - j % i]) {
						match = false;
						break;
					}
				}
				if (match) {
					if (check(n, i)) {
						result -= 1;
					}
				}
			}
		}
		bits[n - 1 - fixed] = 1; 
		for (int i = fixed + 1; i <= len / 2; ++i) {
			if (len % i == 0) {
				result -= solveHard(n, i, fixed);
			}
		}
		return result;
	}
	
	Map<Integer, Map<Integer, Long>> hardMap;
	
	public long solveHard(int n, int len, int fixed) {
		Map<Integer, Long> map;
		if (hardMap.containsKey(len)) {
			map = hardMap.get(len);
		} else {
			map = new HashMap<Integer, Long>();
			hardMap.put(len, map);
		}
		if (map.containsKey(fixed)) {
			return map.get(fixed);
		}
		long result = _solveHard(n, len, fixed);
		map.put(fixed, result);
		return result;
	}


	public long solve(long max) {
		hardMap = new HashMap<Integer, Map<Integer,Long>>();
		bits = new int[64];
		int n = 0;
		while (max > 0) {
			bits[n++] = (int) (max % 2);
			max /= 2;
		}
		if (n == 0) {
			return 0;
		}
		long ans = 0;
		for (int i = 1; i < n; ++i) {
			ans += solveLen(i);
		}
		for (int i = 1; i <= n / 2; ++i) {
			if (n % i == 0) {
				for (int j = 1; j <= i; ++j) {
					ans += solveHard(n, i, j);
				}
			}
		}
		return ans;
	}
	
	public void run() {
		Scanner sc = new Scanner(System.in);
		PrintWriter pw = new PrintWriter(System.out);
		
		long a = sc.nextLong();
		long b = sc.nextLong();
		
		pw.println(solve(b) - solve(a - 1));
		
		pw.flush();
	}
}
