The problem is in line 4. The user never entered anything so there isn't anything to discard, thus your first input gets discarded. And the rest follows. That's why you should first get the input and check for failure instead of checking for failure then getting the input and so on.
Schol-R-LEA commented: Why oh why didn't I think to ask that? +7