N,M,K=map(int, input().split()) A=list(input().split()) s=A[0] D=[int(input()) for i in range(N)] D=sorted(D) import bisect cnt=0 if s=='+': for i in A[1:]: cnt+=N-bisect.bisect_left(D,K-int(i)) else: for i in A[1:]: cnt+=N-bisect.bisect_left(D,K/int(i)) print(cnt)