Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/bit-hamming-masofasi

Hamming distance

Easy 1000 ms 128 MB 28%
Share

Two non-negative integers $a$ and $b$ are given. In how many positions do their binary representations differ? (The shorter representation is considered padded with zeros on the left.) For example, $5 = 101_{2}$ and $3 = 011_{2}$ differ in two positions.

Binary representations of two numbers one above the other; columns with different bits are highlighted

Input

One line with two integers: $a$ and $b$.

Output

One integer — the number of differing bits.

Note

$0 \le a, b \lt 2^{60}$

Examples

Input #1
5 3
Output #1
2
Input #2
0 0
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.