#!/usr/bin/env python3 import bisect def main(): h, w, k = map(int, input().split()) op, *b = input().split() b = list(map(int, b)) a = [ int(input()) for _ in range(h) ] a.sort() b.sort() c = 0 if op == '+': for a_y in a: c += w - bisect.bisect_left(b, k - a_y) elif op == '*': for a_y in a: c += w - bisect.bisect_left(b, (k - a_y + 1) // a_y) print(c) if __name__ == "__main__": main()