#include <bits/stdc++.h>
using namespace std;
int main() {
  long n, tmp1, tmp2, kq = 1;
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  cin >> tmp1;
  n--;
  while (n != 0) {
    cin >> tmp2;
    n--;
    if (tmp2 != tmp1) kq += 1;
    tmp1 = tmp2;
  }
  cout << kq;
  return 0;
}
