#include <bits/stdc++.h>
using namespace std;
int main() {
  int size;
  cin >> size;
  int *array = new int[size];
  int allocate{0};
  for (int i{0}; i < size; i++) {
    allocate = 0;
    cin >> allocate;
    array[i] = allocate;
  }
  int temp{0};
  int piece{1};
  for (int i{0}; i < size - 1; i++) {
    if (array[i] == array[i + 1]) {
      continue;
    } else {
      piece++;
    }
  }
  delete[] array;
  array = nullptr;
  cout << piece << endl;
}
