#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int arr[n];
  int t = n;
  int sum = 0;
  for (int i = 0; i < t; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < t; i++) {
    if (arr[i] != arr[i + 1]) sum++;
  }
  cout << sum << endl;
  return 0;
}
