import java.util.Scanner; public class Main { public static void main(String args[]){ Scanner stdIn = new Scanner(System.in); int n = stdIn.nextInt(); int sum = 1; int size[] = new int[n]; boolean flag = true; for(int i = 0; i < n; i++){ size[i] = stdIn.nextInt(); } for(int i = 1; i < n; i++){ if(flag){ if(size[i] == size[i - 1]){ sum++; }else{ flag = false; } }else{ sum++; flag = true; } } System.out.println(sum); } }