#include <bits/stdc++.h>
using namespace std;
int a[10010000], ans = 0;
void cal(int x) {
  if (a[x] & 1) ans++;
  a[x + 1] += a[x] / 2;
}
int main() {
  int n, i, x;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", &x);
    a[x]++;
  }
  for (i = 0; i <= 10000000; i++) cal(i);
  cout << ans;
}
