<>;$y=$b?$c-$b*2+$_?2:$y+1:1,$c=$b,$b=$_,$\+=$-=$y-$\for glob<>;print