Yeah, But there is always 6 inputs at most. You can write program in this way rather than thinking about from EOF.