这么做
c=int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
d = 0
for i in range(c):
if a[i] == 1:
d += 3
if i > 0 and a[i - 1] == 1:
d -= 2
if i % 2 == 0 and b[i] == 1:
d -= 1
if b[i] == 1:
d += 3
if i > 0 and b[i - 1] == 1:
d -= 2
if i % 2 == 0 and a[i] == 1:
d -= 1
print(d)