#include <bits/stdc++.h>
using namespace std;
int n, ans = 0, temp;
priority_queue<int> q;
int main() {
  scanf("%d", &n);
  while (!q.empty()) q.pop();
  for (int i = 1; i <= n; i++) {
    scanf("%d", &temp);
    q.push(-temp);
  }
  while (!q.empty()) {
    int now = -q.top();
    q.pop();
    if (!q.empty())
      if (now == -q.top())
        now++, q.pop(), q.push(-now);
      else
        ans++;
    else
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
