#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  int n, cnt = 0;
  cin >> n;
  int arr[1000112] = {0};
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    arr[x] += 1;
  }
  for (int i = 0; i <= 1000110; i++) {
    arr[i + 1] += (arr[i] / 2);
    cnt += (arr[i] % 2);
  }
  cout << cnt;
  return 0;
}
