#include <bits/stdc++.h>
int a[3000000];
int main() {
  int t, n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &t), ++a[t];
  for (int i = 0; i <= 2000009; ++i) {
    a[i + 1] += a[i] / 2;
    a[i] %= 2;
  }
  int ans = 0;
  for (int i = 0; i <= 2000010; ++i) {
    ans += a[i];
  }
  printf("%d\n", ans);
}
