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