You are given four integer sequences , , , and , each of length . Count the ways to choose one element from each sequence so that the four chosen values sum to .
In other words, count the ordered index tuples satisfying . Each index is chosen independently. Equal values at different positions are distinct choices.
The first line contains the sequence length . On the -th of the next lines, the values are separated by spaces.
Print the number of valid index tuples on the first line. The answer may exceed the range of a signed 32-bit integer.