#include <bits/stdc++.h>
using namespace std;
int n, m, x, k, l, r, a[2000100];
string s, t, ss, tt;
char c;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  m = 2e6;
  for (int i = 0; i < n; i++) cin >> x, a[x]++;
  for (int i = 0; i < m; i++) {
    if (i) a[i] += a[i - 1] / 2;
    k += a[i] % 2;
  }
  cout << k;
  return 0;
}
