#include <bits/stdc++.h>
using namespace std;
int a[2000010];
int main() {
  int n, x;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &x);
    ++a[x];
  }
  x = 0;
  for (int i = 0; i < 2000000; ++i) {
    x += (a[i] & 1);
    a[i + 1] += (a[i] >> 1);
  }
  printf("%d\n", x);
  return 0;
}
