$/=words;say $0+min $2,$5-max $4-$1,0