#include <bits/stdc++.h>
using namespace std;
long long SUPERBIG = 1e6 + 1;
int main() {
  long long n, a, i, k = 0, b;
  cin >> n;
  cin >> a;
  for (i = 1; i < n; i++) {
    cin >> b;
    if (a != b) {
      k++;
    }
    a = b;
  }
  cout << k + 1;
}
