#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, k[1000024], step = 0, t;
  bool flag = true, flag2;
  scanf("%d", &n);
  for (int i = 0; i < 1000024; i++) k[i] = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &t);
    k[t]++;
  }
  for (int i = 0; i < 1000024; i++) {
    if (k[i] > 1) k[i + 1] += k[i] / 2;
    step += k[i] % 2;
  }
  printf("%d\n", step);
  return 0;
}
