import sys import bisect N,M,K = map(int,input().split()) lsB = input().split() f = lsB.pop(0) lsB = [int(i) for i in lsB] lsB.sort() lsA = [int(input()) for i in range(N)] if f == '*': cnt = 0 for i in range(N): a = lsA[i] c = -(-K//a) ind = bisect.bisect_left(lsB,c) cnt += M-ind print(cnt) else: cnt = 0 for i in range(N): a = lsA[i] c = K-a ind = bisect.bisect_left(lsB,c) cnt += M-ind print(cnt)