#include<bits/stdc++.h>
using namespace std;
int main(){
int n,count=0;
  cin>>n;
  string s,s1="#";
   while(n--){
    cin>>s;
    if(s!=s1)
    count++;
    s1=s;
  }
  cout<<count<<"\n";
  
  return 0;
}