import sys reader = (s.rstrip() for s in sys.stdin) input = reader.__next__ 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 i in range(n)] B.sort() ans = 0 for ai in A: if op == "+": target = k-ai else: target = -(-k//ai) ans += m - bisect_left(B, target) print(ans)