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