(read a for b in ${a/$} { b=${b::1} ((1$b+0))&&e=$c$e ((0$b 1))&&f+=$c c=$b } f+=${e:?} f=${f/a*} echo $[-1**${#f}])&&. *