#include <bits/stdc++.h>
using namespace std;
int main() {
  long int n, i, j, k, l, o, count = 0;
  scanf("%ld", &n);
  map<long int, long int> m;
  for (i = 0; i < n; i++) {
    scanf("%ld", &j);
    m[j]++;
  }
  map<long int, long int>::iterator it;
  for (it = m.begin(); it != m.end(); it++) {
    j = it->first;
    k = it->second;
    l = log2l(k);
    if (l != 0) {
      while (l != 0) {
        o = pow(2, l);
        m[l + j]++;
        m[j] = m[j] - o;
        k = m[j];
        if (k == 0) break;
        l = log2l(k);
      }
    }
    k = it->second;
    if (k != 0) count++;
  }
  printf("%ld", count);
  return 0;
}
