from bisect import * from math import floor N,M,K = map(int,input().split()) l = list(map(str,input().split())) op = l[0] B = [0]*M for i in range(1,M+1): B[i-1] = int(l[i]) A = [int(input()) for _ in range(N)] A,B = sorted(A),sorted(B) ans = 0 if op == "+": for i in range(N): b = bisect_left(B,K-A[i]) ans += (M-b) else: for i in range(N): b = bisect_left(B,floor(K/A[i])) ans += (M-b) print(ans)