#include<bits/stdc++.h> using namespace std; int a[105],n,x,ans=0; int main () { cin>>n; for (int i=1; i<=n; i++) { cin>>x; a[x]++; } for (int i=0; i<=100; i++) { ans+=a[i]%2; a[i+1]+=a[i]/2; } cout<<ans<<endl ; return 0; }