#include <bits/stdc++.h>
using namespace std;
const int P = 1000000007;
const int maxn = 1000500;
vector<pair<int, int> > v;
int a[maxn], b[maxn], d[2 * maxn];
int i, ans, s, j, n, m, t, k, x, y;
int main() {
  cin >> n >> x;
  t = x % 10;
  ans = 1;
  for (i = 1; i < n; i++) {
    cin >> x;
    if (t == x / 10) ans++;
    t = x % 10;
  }
  cout << ans;
}
