Recently, Duff has been practicing weight lifting. As a hard practice, Malek gave her a task. He gave her a sequence of weights. Weight of *i*-th of them is 2<sup class="upper-index">*w*<sub class="lower-index">*i*</sub></sup> pounds. In each step, Duff can lift some of the remaining weights and throw them away. She does this until there's no more weight left. Malek asked her to minimize the number of steps.

Duff is a competitive programming fan. That's why in each step, she can only lift and throw away a sequence of weights 2<sup class="upper-index">*a*<sub class="lower-index">1</sub></sup>, ..., 2<sup class="upper-index">*a*<sub class="lower-index">*k*</sub></sup> if and only if there exists a non-negative integer *x* such that 2<sup class="upper-index">*a*<sub class="lower-index">1</sub></sup> + 2<sup class="upper-index">*a*<sub class="lower-index">2</sub></sup> + ... + 2<sup class="upper-index">*a*<sub class="lower-index">*k*</sub></sup> = 2<sup class="upper-index">*x*</sup>, i. e. the sum of those numbers is a power of two.

Duff is a competitive programming fan, but not a programmer. That's why she asked for your help. Help her minimize the number of steps.
The first line of input contains integer *n* (1 ≤ *n* ≤ 10<sup class="upper-index">6</sup>), the number of weights.

The second line contains *n* integers *w*<sub class="lower-index">1</sub>, ..., *w*<sub class="lower-index">*n*</sub> separated by spaces (0 ≤ *w*<sub class="lower-index">*i*</sub> ≤ 10<sup class="upper-index">6</sup> for each 1 ≤ *i* ≤ *n*), the powers of two forming the weights values.
n=int(input())
l=list(map(int,input().split()))
cnt=[0]*(10**6+100)
for i in l:
  cnt[i]+=1
s=0
ans=0
for i in cnt:
 s+=i
 ans+=s%2
 s//=2
print(ans)
