#include <bits/stdc++.h>
using namespace std;
int N;
int br[1 << 20];
void scan() {
  scanf("%d", &N);
  int x;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &x);
    br[x]++;
  }
}
void solve() {
  int res = 0;
  for (int* i = br; i != br + 1000050; ++i) {
    res += ((*i) & 1);
    (*(i + 1)) += ((*i) >> 1);
  }
  printf("%d\n", res);
}
int main() {
  scan();
  solve();
}
