ans = 0
mode = 0
n = int(input())
for i in range(n):
    p = int(input())
    if p == 1:
        if mode == 2:
            mode = 0
        elif mode == 0:
            mode = 1
            ans += 1
    if p == 2:
        if mode != 2:
            ans += 1
            mode = 2
    if p == 3:
        if mode == 1:
            mode = 2
            ans += 1
        elif mode == 2:
            mode = 0
        else:
            ans += 1
print(ans)
