#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, res = 0;
  int a[100001];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int tmp = a[0];
  for (int i = 0; i < n; i++) {
    if (a[i] != tmp) {
      res++;
      tmp = a[i];
    }
  }
  cout << res + 1 << endl;
}
