# coding: utf-8 # Your code here! import sys readline = sys.stdin.readline read = sys.stdin.read n,m,k = [int(i) for i in readline().split()] x = read().split() op = x[0] b = list(map(int,x[1:m+1])) a = list(map(int,x[m+1:])) #a.sort() b.sort() from bisect import bisect_left as bis #print(op,b,a) if op == "+": ans = 0 for ai in a: ans += m - bis(b,k-ai) print(ans) else: ans = 0 for ai in a: ans += m - bis(b,k//ai) print(ans)