import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int prev = 0; long count = 0; boolean isZunda = false; for (int i = 0; i < n; i++) { int x = sc.nextInt(); if (isZunda) { if (x == prev) { count++; } else { isZunda = false; } } else { count++; isZunda = true; } prev = x; } System.out.println(count); } }