#include <iostream>
#include <fstream>
#include <sstream>
usingnamespace std;
int main ()
{
int n, l=0;
int number[n];
cin>>n;
for (int i=0;i<n;i++)
{
cin>>number[i] ;
}
for (int i=0;i<n-1;i++)
{
number[i]=number[i]%10;
stringstream first;
first<<number[i+1];
string s=first.str();
charconst* fdigit=s.c_str();
cout<<"this is numaru"<<number[i]<<"\n";
cout<<"this is fdigit"<<*fdigit<<"\n";
if (number[i]!=*(fdigit))
{
l=l+1;}
cout<<"this is l"<<l<<"\n";
}
cout<<l;
return 0;
}