#include <bits/stdc++.h>
const size_t kLimit = 2000000;
std::vector<bool> g_bits(kLimit);
void Update(int i) {
  if (g_bits[i]) {
    g_bits[i] = false;
    Update(i + 1);
  } else {
    g_bits[i] = true;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int w;
    scanf("%d", &w);
    Update(w);
  }
  int result = 0;
  for (int i = 0; i < g_bits.size(); ++i) {
    if (g_bits[i]) ++result;
  }
  printf("%d\n", result);
  return 0;
}
