#include <bits/stdc++.h>
using namespace std;
long long n;
vector<long long> v;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  v.resize(2000000, 0);
  for (int i = 0; i < n; i++) {
    long long h;
    cin >> h;
    v[h]++;
  }
  for (int i = 0; i < v.size(); i++) {
    if (v[i] >= 2) {
      if (v[i] & 1) {
        v[i + 1] += v[i] / 2;
        v[i] = 1;
      } else {
        v[i + 1] += v[i] / 2;
        v[i] = 0;
      }
    }
  }
  int counter = 0;
  for (int i = 0; i < v.size(); i++) {
    if (v[i]) counter++;
  }
  cout << counter;
  return 0;
}
