#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
const int N = 81;
const int delta = 10453;
long long a[maxn], n, ans = 1;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (int i = 1; i < n; i++) {
    if (a[i] != a[i + 1]) ans++;
  }
  cout << ans;
}
