import bisect n, m, k = map(int, input().split()) op_line = input().split() op = op_line[0] B = list(map(int, op_line[1:m+1])) A = [int(input()) for _ in range(n)] B.sort() count = 0 if op == '+': for a in A: target = k - a if target <= 0: count += m else: idx = bisect.bisect_left(B, target) count += (m - idx) else: # '*' for a in A: if a == 0: continue # Since A[i] >=1 per problem constraints t = (k + a - 1) // a idx = bisect.bisect_left(B, t) count += (m - idx) print(count)