#include <bits/stdc++.h>
using namespace std;
int freq[1000022] = {0};
int main() {
  int N, w;
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    scanf("%d", &w);
    freq[w]++;
  }
  int ans = 0;
  for (int i = 0; i < 1000022; i++) {
    freq[i + 1] += freq[i] / 2;
    ans += freq[i] % 2;
  }
  printf("%d\n", ans);
  return 0;
}
