#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 1e3;
int a[maxn];
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    int tmp;
    scanf("%d", &tmp), a[tmp]++;
  }
  int cnt = 0;
  for (int i = 0; i < maxn; i++) {
    a[i + 1] += a[i] / 2;
    cnt += a[i] & 1;
  }
  cout << cnt;
  return 0;
}
