import sys input=sys.stdin.readline def main(args): N = int(input()) A = list(map(int,input().split())) ans = 0 flag = 0 for i,a in enumerate(A): print("a",a) if not flag: ans += 1 flag = 1 else: flag = 0 if a == A[i-1]: ans += 1 flag = 1 print("ans",ans) print(ans) if __name__ == '__main__': main(sys.argv[1:])