#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int c = 0;
  int x;
  int a[n - 1];
  for (int i = 1; i <= n; i++) {
    cin >> x;
    a[i - 1] = x;
    if (a[i - 1] != a[i - 2]) {
      c++;
    }
  }
  cout << c;
}
