#include <bits/stdc++.h>
using ull = unsigned long long;
using ll = long long;
using namespace std;
ll dmod = 1e9 + 7;
ll fpow(ll a, ll b, ll mod) {
  ll x = 1;
  while (b != 0) {
    if (b & 1) {
      x *= a;
      x %= mod;
    }
    a = a * a;
    a %= mod;
    b >>= 1;
  }
  return x;
}
void solve() {
  ll n;
  cin >> n;
  vector<string> vs;
  for (ll i = 0; i < n; ++i) {
    string s;
    cin >> s;
    vs.push_back(s);
  }
  string now = vs[0];
  ll cn = 1;
  for (ll i = 1; i < n; ++i) {
    if (vs[i] == now) {
      continue;
    } else {
      cn++;
      now = vs[i];
    }
  }
  cout << cn << "\n";
}
void start() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(10);
}
int main() {
  start();
  ll t = 1;
  while (t--) {
    solve();
  }
}
