from bisect import bisect_right n, m, k = map(int, input().split()) B = list(input().split()) op = B[0] B = list(map(int, B[1:])) A = [int(input()) for _ in range(n)] A.sort() B.sort() ans = 0 for i in range(n): if op == '+': res = k - A[i] - 1 elif op == '*': res = k // A[i] if k % A[i] == 0: res -= 1 cnt = bisect_right(B, res) ans += cnt print(n * m - ans)