You are given four integer arrays A, B, C, and D, all of the same size.
Write a program that counts the number of tuples (a,b,c,d) such that A[a]+B[b]+C[c]+D[d]=0. Here a, b, c, and d are indices from 0 to n−1, choosing one element independently from each of the four arrays.
The first line contains the array size n (1≤n≤4000). Each of the next n lines contains the integers belonging to A, B, C, and D, separated by spaces; the four integers on the i-th line are A[i], B[i], C[i], and D[i] in that order. The absolute value of every integer is at most 228.
Print the number of tuples (a,b,c,d) whose sum is 0.