#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
  int n,ans=1;
  cin>>n;
  vector<string> c;
  string str,ring;
  cin>>str;
  c.push_back(str);
  
  for(int i=1;i<n;i++){
    cin>>ring;
    c.push_back(ring);
  }
  
  sout(c.begin(),c.end());
  for(int i=0;i<n-1;i++){
    if(c[i]!=c[i+1])ans++;
  }
  
  cout<<ans<<endl;
  return 0;
}