<>;$/=$";$n+=(${-$_}++<=>1)%3-1for<>;print"$n\n"