#include <bits/stdc++.h>
using namespace std;
int powers[1000000 * 2 + 1], N;
int main() {
  ios_base::sync_with_stdio(false);
  cin >> N;
  for (int i = 0; i < N; ++i) {
    int tmp;
    cin >> tmp;
    ++powers[tmp];
  }
  for (int i = 0; i <= 1000000; ++i) {
    if (powers[i] <= 1) continue;
    for (int e = 20; e >= 1; --e) {
      int div = (1 << e);
      if (div <= powers[i]) {
        ++powers[e + i];
        powers[i] -= div;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i <= 1000000 * 2 + 1; ++i)
    if (powers[i] == 1) ++ans;
  cout << ans << endl;
}
