HomeVolumesContestsSectionsForumsUsersPrintHelpAbout

Volumes > Chapter 3. Repetition structures > problem:


13. Round numbers

Volume problems

• 05. Factorial
• 06. X to the power of Y
• 07. Fibonacci Series
• 08. Binary to decimal
• 09. Decimal to binary
• 10. Maximum
• 11. Perfect numbers
• 12. Wonder primes
• 13. Round numbers
• 14. Tower of Happiness
• 2. Molecules

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