#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
using namespace std;
const int maxn = 1e5 + 10;
const int mod = 1000000007;
const long long INF = 1e18;
const int MX = 2000000001;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0);
  long long t, q, n, a, b, k, l, m, x = 0, y = 0, ans = 0, temp = 0, res = 0;
  cin >> n;
  long long magnet[n];
  for (long long i = 0; i < (n); i++) cin >> magnet[i];
  for (long long i = 1; i < (n); i++)
    if (magnet[i] != magnet[i - 1]) ans++;
  cout << ans + 1;
}
