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