n,m,k=map(int,input().split()) c=list(map(str,input().split())) a=[0]*(n) for i in range(n): a[i]=int(input()) op=c[0] b=[0]*m for i in range(m): b[i]=int(c[i+1]) a.sort() b.sort() from bisect import bisect_right if op=='+': cnt=n*m for i in range(n): cnt-=bisect_left(b,k-a[i]) print(cnt) else: cnt=n*m for i in range(n): cnt-=bisect_left(b,k//a[i]) print(cnt)