#include <bits/stdc++.h>
long long int e[2000010] = {0};
int main() {
  long long int n, i, a, sum;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &a);
    e[int(a)] += 1;
  }
  for (i = 0; i <= 2000009; i++) {
    if (e[i] >= 2) {
      e[i + 1] += e[i] / 2;
      e[i] %= 2;
    }
  }
  sum = 0;
  for (i = 0; i <= 2000009; i++) {
    if (e[i] == 1) sum += 1;
  }
  printf("%lld\n", sum);
}
