from bisect import bisect_left from sys import stdin def main(): input = lambda: stdin.readline()[:-1] N, M, K = map(int, input().split()) B = input().split() A = [int(input()) for _ in [0] * N] b = sorted(map(int, B[1:])) A.sort() ans = 0 if B[0] == '+': for a in A: ans += M - bisect_left(b, K - a) else: for a in A: ans += M - bisect_left(b, K / a) print(ans) main()