#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 100;
struct cmp {
  bool operator()(const int a, const int b) const { return a > b; }
};
priority_queue<int, vector<int>, cmp> q;
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    q.push(x);
  }
  int ans = 0;
  while (!q.empty()) {
    int i = q.top();
    q.pop();
    if (q.empty()) {
      ans++;
      break;
    }
    int j = q.top();
    if (i == j) {
      q.pop();
      q.push(j + 1);
    } else
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
