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?
The first line contains the number of sticks n (1≤n≤100000). The second line contains n integers, the lengths of the sticks, where every length is between 1 and 1000 inclusive.
Print the number of sticks that remain after all sticks of equal length have been glued together.