Damn, I'm stuck at 39 in Bash. The main character-eating issue for me is the last test, where you have to make it 0 if there are no inputs. Maybe there's someway to combine the first line with the rest of the lines, because the first one is 0 when the answer should be 0, which would get rid of number conversion and the initial
read in one go. But I don't know how I would go about that.