#include <bits/stdc++.h>
using namespace std;
bool cmp(const pair<int, int>& p1, const pair<int, int>& p2) {
  return p1.first < p2.first;
}
int mark[1002005];
int power[30];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    mark[a] += 1;
  }
  power[0] = 1;
  for (int i = 1; i < 26; i++) power[i] = power[i - 1] * 2;
  int ans = 0;
  for (int i = 0; i <= 1001000; i++) {
    if (mark[i]) {
      for (int j = 0; j < 26; j++) {
        if (((power[j]) & (mark[i]))) {
          if (j == 0)
            ans++;
          else {
            mark[i + j]++;
          }
        }
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}
