n = int(input()) m1 = int(input()) used = [1]*(n+1) now = 0 for a in list(map(int,input().split())): now += a used[now] = 0 m2 = int(input()) for a in list(map(int,input().split())): now -= a used[now] = 0 print(sum(used))