#include <bits/stdc++.h>
using namespace std;
int cnt[1000100];
int main() {
  int n;
  scanf("%d", &n);
  for (int x, i = 0; i < n; ++i) {
    scanf("%d", &x);
    ++cnt[x];
  }
  int ans = 0;
  for (int i = 0; i < 1000100 - 1; ++i) {
    cnt[i + 1] += cnt[i] / 2;
    ans += cnt[i] % 2;
  }
  cout << ans;
  return 0;
}
