from bisect import bisect_left n, m, k = map(int, input().split()) op, *B = input().split() B = list(map(int, B)) A = [int(input()) for _ in range(n)] A.sort() B.sort() res = 0 if op == '+': for a in A: t = bisect_left(B, k - a) res += m - t else: for a in A: t = bisect_left(B, (k + a - 1) // a) res += m - t print(res)