#include <bits/stdc++.h>
using namespace std;
int a[1010010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int i, n, temp;
  cin >> n;
  for (i = 0; i < n; ++i) {
    cin >> temp;
    a[temp]++;
  }
  int carry = 0;
  i = 0;
  while (i < 1010000) {
    a[i] += carry;
    carry = a[i] / 2;
    a[i] = a[i] % 2;
    i++;
  }
  int sum = 0;
  for (i = 0; i < 1010000; ++i) {
    if (a[i] == 1) sum++;
  }
  cout << sum << endl;
  return 0;
}
