import bisect import math n, m, k = map(int, input().split()) bw = list(map(str, input().split())) a = [int(input()) for i in range(n)] a.sort() op = bw.pop(0) b = [int(i) for i in bw] b.sort() ans = 0 if op == "+": c = bisect.bisect_left(b,k) ans += len(b[c:])*len(a) for i in b[:c]: d = bisect.bisect_left(a,k-i) ans += len(a[d:]) else: for i in range(n): ans += m - bisect.bisect_left(b,math.ceil(k/a[i])) print (ans)