from collections import Counter import math n = int(input()) xx = list(map(int,input().split())) ll = [0]*n c = 0 for i in range(n): if i == 0: c += 1 ll[i] = 1 else: if xx[i-1] == xx[i]: c += 1 ll[i] = 1 else: if ll[i-1] != 1: ll[i] = 1 c += 1 print(c)