Right, you have to debug this code. That's what you're asking us to do, and it's something you have to get into the habit of doing.
You do that by tracing through the code, either with a piece of paper and a pencil, or with a debugger, or just by adding print statements. Go through each line and figure out what you expect it to do, then figure out what it's actually doing. One of those lines isn't doing what you think it's doing, and you have to narrow it down to figure out which one it is.
Hint: when do you read in the second number?