import bisect n,m,k=map(int,input().split()) tmp=list(map(str,input().split())) op=tmp[0] arr1=[int(tmp[i]) for i in range(1,m+1)] arr2=[int(input()) for i in range(n)] arr2=sorted(arr2) ans=0 for i in range(m): if op=='+': pos=bisect.bisect_left(arr2,k-arr1[i]) ans+=n-pos else: pos=bisect.bisect_left(arr2,(k+arr1[i]-1)//arr1[i]) ans+=n-pos print(ans)