#include <bits/stdc++.h>
using namespace std;
struct debugger {
  template <typename T>
  debugger& operator,(const T& v) {
    cerr << v << " ";
    return *this;
  }
} dbg;
int n;
int v[1000021];
int MAX;
int mov() {
  int ans = 0;
  for (int i = 0; i < MAX + 20; i++) {
    v[i + 1] += v[i] / 2;
    if (v[i] & 1) ans++;
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    v[x]++;
    MAX = max(MAX, x);
  }
  cout << mov() << endl;
}
