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