from sys import stdin import bisect n,m,k = map(int,stdin.readline().rstrip().split()) li = list(map(str,stdin.readline().rstrip().split())) op = li[0] b = [int(li[i]) for i in range(1,m+1)] a = [int(stdin.readline().rstrip()) for _ in range(n)] a.sort();b.sort() point = 0 now = 0 for i in range(n): if op == "+": A = k-a[i] B = bisect.bisect_left(b,A) point += m-B else: A = k/a[i] B = bisect.bisect_left(b,A) point += m-B print(point)