#include <bits/stdc++.h>
using namespace std;
int a[1010100];
int main() {
  int n;
  scanf("%d", &n);
  for (int(i) = (0); (i) < (n); (i)++) {
    int first;
    scanf("%d", &first);
    a[first]++;
  }
  int ans = 0;
  for (int(i) = (0); (i) < (1010100 - 1); (i)++) {
    a[i + 1] += a[i] / 2;
    ans += (a[i] % 2);
  }
  cout << ans << endl;
}
