#include <bits/stdc++.h>
using namespace std;
void solve() {
  const long long mxN = 1e5;
  int n, a, counter = 0;
  int ar[mxN] = {};
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a;
    ar[i] = a;
  }
  for (int i = 0; i < n; i++) {
    if (ar[i] != ar[i + 1]) {
      counter++;
    }
  }
  cout << counter;
}
int main() {
  solve();
  return 0;
}
