N = int(input()) state = [1]*(N+1) v = 0 _ = input() A = list(map(int, input().split())) for a in A: v += a state[v] = 0 _ = input() B = list(map(int, input().split())) for b in B: v -= b state[v] = 0 print(sum(state))