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