#include <bits/stdc++.h>
using namespace std;
const int N = 2 * 1e6;
int a[N];
int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int tmp;
    cin >> tmp;
    a[tmp]++;
  }
  int res = 0;
  for (int i = 0; i < N; ++i) {
    if (a[i] % 2) ++res;
    a[i + 1] += (a[i] / 2);
  }
  cout << res << endl;
  return 0;
}
