<>;$%=<>;$x+=$_*$%**$_/$%,$\+=++$_?$%**$_/$_:log$%for glob<>;print$x,$/