from bisect import bisect_left N,M,K = map(int,input().split()) op, *B = input().split() B = sorted([int(s) for s in B]) A = [int(input()) for _ in range(N)] ans = 0 for a in A: if op == "+": c = K - a else: c = K // a ans += M - bisect_left(B,c) print(ans)