#include <bits/stdc++.h>
using namespace std;
int weight[int(1e6 + 2000)] = {};
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n, x, ans = 0;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x, weight[x]++;
  for (int i = 0; i < 1e6 + 2000; i++) {
    weight[i + 1] += weight[i] / 2;
    ans += weight[i] % 2;
  }
  cout << ans;
  return 0;
}
