<>;$\+=abs$_-$_[@_/2]for@_=sort{$a-$b}split$",<>;print