f=[1]*(gets.to_i+1) s=0 n=gets.to_i xs=gets.split(" ").map{|e| e.to_i} xs.each{|x| f[s]=0 s+=x } n=gets.to_i xs=gets.split(" ").map{|e| e.to_i} xs.each{|x| f[s]=0 s-=x } puts f.sum