#B2140. Classifying Binary Numbers

    ID: 11222 Type: Default 1000ms 256MiB

Classifying Binary Numbers

Classifying Binary Numbers

Given a positive integer nn (1n10001 \le n \le 1000), we define a number to be of class AA if, in its binary representation, the number of 11s is greater than the number of 00s; otherwise, it belongs to class BB. For example, (13)10=(1101)2(13)_{10} = (1101)_2 has three 11s and one 00, so it is an AA class number, whereas (10)10=(1010)2(10)_{10} = (1010)_2 has two 11s and two 00s, making it a BB class number. Write a program that counts all numbers from 11 to nn belonging to class AA and class BB, respectively.

inputFormat

The input consists of a single integer nn (1n10001 \le n \le 1000).

outputFormat

Output two integers separated by a space. The first integer is the number of class AA numbers and the second is the number of class BB numbers among all numbers from 11 to nn.

sample

13
7 6