#include <bits/stdc++.h>
using namespace std;
long long a, c, d, e, f, g, h;
string s;
void Urvatullo_Atoev() {
  cin >> a;
  long long b[a];
  for (long long i = 0; i < a; i++) {
    cin >> b[i];
    if (b[i] != b[i + 1]) {
      c++;
    }
    i++;
  }
  cout << c;
}
int main() { Urvatullo_Atoev(); }
