#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000 + 10;
int a[N], b[N * 5];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < N * 5; i++) b[i] = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  int mini = a[0];
  for (int i = 0; i < n; i++) a[i] -= mini;
  for (int i = 0; i < n; i++) b[a[i]]++;
  for (int i = 0; i < N * 5; i++) {
    b[i + 1] += b[i] / 2;
    b[i] %= 2;
    if (b[i]) ans++;
  }
  cout << ans << "\n";
}
