#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios::sync_with_stdio(false);
  int arr[100001];
  int n, temp, cnt = 0;
  string s;
  cin >> n;
  temp = n;
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 1; i <= n; i++) {
    if (arr[i] != arr[i - 1]) {
      cnt++;
    }
  }
  cout << cnt;
}
