R=range J=lambda:list(map(int,input().split())) N=J() A=J() B=J() print(len([j for j in R(M) if B[j]