#include <bits/stdc++.h>
using namespace std;
int popcount(int n) {
  auto result = 0;
  while (n != 0) {
    result += n % 2;
    n /= 2;
  }
  return result;
}
int duff(int w[], int n) {
  auto max = max_element(w, w + n);
  vector<int> sum(*max + 1);
  for (auto i = 0; i != n; i++) {
    sum[w[i]]++;
  }
  auto result = 0;
  for (auto i = 0; i != *max; i++) {
    sum[i + 1] += sum[i] / 2;
    result += sum[i] % 2;
  }
  result += popcount(sum.back());
  return result;
}
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int w[n];
  for (auto i = 0; cin >> w[i]; i++) {
    ;
  }
  cout << duff(w, n);
  return 0;
}
