$/=words;say $/[2..*].sum-$1*+^-$0