from itertools import accumulate def main(): N = int(input()) Z = [0]*(N+1) input() *A, = accumulate(map(int, input().split())) input() *B, = accumulate(map(int, input().split())) for a in A: Z[a] = 1 for b in B: Z[N-b] = 1 print(N+1-sum(Z)) if __name__ == '__main__': main()