import bisect N, M, K = map(int,input().split()) B = input().split() C = sorted([int(B[l]) for l in range(1,M+1)]) ans = 0 if B[0] == "+": for k in range(N): A = int(input()) ans += M-bisect.bisect_left(C,K-A) else: for k in range(N): A = int(input()) ans += M-bisect.bisect_left(C,K//A) print(ans)