HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Sections > Unsorted > problem:


Round numbers

Section problems

• City Tour
• Buying hay
• Sum until 0
• Flowchart 1
• Flowchart 2
• Flowchart 3
• Name-Surname
• Wonder primes
• Round numbers
• Sum less than N
• Perfect numbers
• Sum of N numbers
• How many digits?
• find the numbers
• Fibonacci Series
• SAME OR DIFFERENT
• Binary to decimal

Feedback

If you notice incorrect translations in Contester, please let author know.

Time limit 1000/1000/1000/1000 ms. Memory limit 65000/65000/65000/65000 Kb.

Problem description

A positive integer N is said to be a "round number" if the binary representation of N has as many or more zeroes as it has ones. For example, the integer 9, when written in binary form, is 1001. 1001 has two zeroes and two ones; thus, 9 is a round number. The integer 26 is 11010 in binary; since it has two zeroes and three ones, it is not a round number.

Write a program that tells how many round numbers appear in the inclusive range given by the input.

Input

There are two integers A and B (0 ≤ A ≤ B ≤ 1000000).

Output

Number of round numbers in given range.

Example

stdin stdout

2 12

6

Для отправки решений необходимо выполнить вход.

www.contester.ru