#include <bits/stdc++.h>
using namespace std;
const int MXN = 2 * 1024 * 1024;
int cnt[MXN];
int n;
int solve() {
  int ans = 0;
  for (int i = 0; i < MXN - 1; i++) {
    cnt[i + 1] += cnt[i] / 2;
    ans += cnt[i] % 2;
  }
  return ans;
}
int main() {
  while (scanf("%d", &n) == 1) {
    memset(cnt, 0, sizeof(cnt));
    int t;
    while (n--) {
      scanf("%d", &t);
      cnt[t]++;
    }
    printf("%d\n", solve());
  }
  return 0;
}
