#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, a, x, count = 0;
  cin >> n;
  for (int i = 0; i == 1; i++) {
    cin >> a;
    x = a;
  }
  for (int i = 0; i <= n - 1; i++) {
    cin >> a;
    if (a != x) count++;
    x = a;
  }
  cout << count << endl;
  return 0;
}
