#include <bits/stdc++.h>
using namespace std;
const int maxw = 3e6;
int v[maxw];
int main() {
  int n, w;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &w);
    ++v[w];
  }
  int ans = 0;
  for (int i = 0; i < maxw - 1; ++i) {
    v[i + 1] += v[i] >> 1;
    v[i] &= 1;
    ans += v[i];
  }
  printf("%d", ans);
  return 0;
}
