#include <bits/stdc++.h>
using namespace std;
const int maxn = 5e6;
int a[maxn], ans;
int main() {
  ios_base::sync_with_stdio(0);
  int n;
  cin >> n;
  while (n--) {
    int tmp;
    cin >> tmp;
    a[tmp]++;
  }
  for (int i = 0; i < maxn; i++) {
    a[i + 1] += a[i] / 2;
    ans += a[i] % 2;
  }
  cout << ans << endl;
  return 0;
}
