Return the first value of the input array if it is non-empty. Otherwise 0.