Sticks

No attempts yetTime limit1sMemory limit128 MB

Problem

You are given a collection of sticks whose lengths are positive integers. Any two sticks that have the same length can be glued together into a single stick whose length is twice as long. Keep gluing sticks together as long as two sticks share a length, that is, until every remaining stick has a distinct length. How many sticks are left at the end?

Input

The first line contains the number of sticks nn (1n1000001 \le n \le 100\,000). The second line contains nn integers, the lengths of the sticks, where every length is between 11 and 10001000 inclusive.

Output

Print the number of sticks that remain after all sticks of equal length have been glued together.