from bisect import bisect_left n, m, k = map(int, input().split()) opb = list(input().split()) ope = opb[0] blst = [int(b) for b in opb[1:]] alst = [int(input()) for _ in range(n)] blst.sort() ans = 0 for a in alst: if ope == "+": pos = k - a else: pos = k / a ans += m - bisect_left(blst, pos) print(ans)