from sys import stdin 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() pa = 0;pb = 0;point = 0 for i in a: for j in b: if op == "+": if i+j >= k: point += 1 else: if i*j >= k: point += 1 print(point)