n=int(input()) s=[1]*(n+1) for _ in range(2): m=int(input()) a=list(map(int,input().split())) p=0 s[p]=0 for i in range(m): p+=a[i] s[p]=0 s.reverse() print(sum(s))