#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> cnt(1000100, 0);
  for (int i = 0; i < n; ++i) {
    int w;
    cin >> w;
    ++cnt[w];
  }
  int step = 0;
  for (int i = 0; i < 1000099; ++i) {
    cnt[i + 1] += cnt[i] / 2;
    step += cnt[i] % 2;
  }
  cout << step << endl;
}
