#include <bits/stdc++.h>
const int inf = 12345678;
const long long int mod = 1e9 + 7;
using namespace std;
int X[2000005] = {0};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long int n, t;
  cin >> n;
  long long m = 0;
  for (int i = 0; i < n; i++) cin >> t, X[t]++;
  int count = 0;
  for (int i = 0; i <= 2000000; i++) {
    if (X[i]) {
      X[i + 1] += X[i] / 2;
      count += X[i] % 2;
    }
  }
  cout << count << endl;
  return 0;
}
