n = int(input())
a = []
for i in range(n):
    a.append(int(input()))
type = 0
cnt = 0
for i in range(n):
    if type == 0:
        if a[i] == 1:
            type = 1
        elif a[i] == 2:
            type = 2
        cnt += 1
    elif type == 1:
        if a[i] == 2 or a[i] == 3:
            type = 2
            cnt += 1
    else:
        if a[i] == 3 or a[i] == 1:
            type = 0
print(cnt)
