for some simple HW code I wrote I needed to get 7 arguments via the scanf function:
scanf(\"%d %d %d %d\\n\", &vodka, &country, &life, &glut)
When you have a whitespace in the format string, you tell scanf() to ignore any number of whitespace characters. So the spaces you have between the %d requires to input a non-whitespace char(s) which are consumed for each of the subsequent %d.
The effect of spaces and \n in the following scanf() calls you have isn't quite obvious. But the newline character at the end of each last scanf() forces you to input a non-whitespace char. Hence, it looks like scanf() requires an extra input.
However, you don't really any whitespace characters here as %d would always ignore whitespace characters. So simply remove all spaces and \n characters from the format strings.