from bisect import bisect_left,bisect def lmtB(A): if op=="+": return K-A else: return K/A N,M,K=map(int,input().split()) op,*b=input().split() B=list(map(int,b)) B.sort() cnt=0 for i in range(N): limit_b=lmtB(int(input())) cnt += M - bisect_left(B,limit_b) print(cnt)