import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int k = sc.nextInt(); boolean isPlus = (sc.next().charAt(0) == '+'); int[] colums = new int[m]; for (int i = 0; i < m; i++) { colums[i] += sc.nextInt(); } Arrays.sort(colums); int[] rows = new int[n]; for (int i = 0; i < n; i++) { rows[i] = sc.nextInt(); } Arrays.sort(rows); int idx = n; long sum = 0; for (int i = 0; i < m; i++) { if (isPlus) { while (idx > 0 && rows[idx - 1] + colums[i] >= k) { idx--; } } else { while (idx > 0 && rows[idx - 1] >= (k + colums[i] - 1) / colums[i]) { idx--; } } sum += n - idx; } System.out.println(sum); } }