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() ans = 0 if op == '+': for x in a: ans += m - bisect_left(b, k - x) else: for x in a: ans += m - bisect_left(b, (k - 1) // x + 1) print(ans)