#include <bits/stdc++.h>
using namespace std;
int cnt[2000005];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    cnt[v]++;
  }
  int ans = 0;
  int killed = 0;
  for (int i = 0; i < 2000002; i++) {
    int left = cnt[i] % 2;
    cnt[i + 1] += cnt[i] / 2;
    cnt[i] = left;
  }
  for (int i = 0; i < 2000002; i++) {
    ans += cnt[i];
  }
  cout << ans << endl;
  return 0;
}
