import bisect N, M, K = [int(x) for x in input().split()] C = [x for x in input().split()] B = [int(x) for x in C[1:]] A = [int(input()) for _ in range(N)] B.sort() ans = 0 for j in range(N): if C[0] == '+': ans += M - bisect.bisect_left(B, K - A[j]) else: ans += M - bisect.bisect_left(B, K // A[j]) print(ans)