#include<iostream> char c,lc; int n,tn; int main(){ scanf("%d",&n); for(int i=0;i<n;i++){ scanf("%c %c",&c,&c); if(c!=lc) tn++; lc=c; } printf("%d",tn+1); return 0; }