from bisect import bisect_left N,M,K = map(int,input().split()) B = list(input().split()) op = B.pop(0) B = sorted(list(map(int,B))) A = sorted([int(input()) for _ in range(N)]) if op=="+": cnt = 0 for i in range(N): a = A[i] if a>=K: cnt += M else: ind = bisect_left(B,K-a) cnt += M-ind else: cnt = 0 for i in range(N): a = A[i] if a>=K: cnt += M else: ind = bisect_left(B,K//a+bool(K%a)) cnt += M-ind print(cnt)