#include <stdio.h> int main() { int a, b; int n; scanf("%d", &n); scanf("%d", &a); int Count=1; int i; for(i=0; i<n-1; ++i) { scanf("%d", &b); if((a%10)==(b/10)) ++Count; a=b; } printf("%d\n", Count); return 0; }