#include <bits/stdc++.h>
using namespace std;
int cnt[1234567];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int mn = 1e9, mx = 0;
  for (int i = 0; i < n; i++) {
    int w;
    cin >> w;
    cnt[w]++;
    mn = min(mn, w);
    mx = max(mx, w);
  }
  int ans = 0;
  for (int x = mn; x < mx + 100; x++) {
    if (cnt[x] % 2 == 1) {
      ans++;
    }
    cnt[x + 1] += cnt[x] / 2;
  }
  cout << ans << endl;
  return 0;
}
