Here's my suggestion.
// Read 1 from the first line.
if(scanf("%d", &j) == 1){
printf("Got %d lines\n", j);
}
// Read the rest of the line but don't
// save it. This is the end of the first line
scanf("%*[^\n]s");
// Read the next line but don't save it.
// This is the end of the second line.
scanf("%*[^\n]s");
// Now read the 2 from the third line.
if(scanf("%d", &j) == 1){
printf("Got %d lines\n", j);
}
// Read the rest of the line but don't
// save it. This is the end of line 3
scanf("%*[^\n]s");
// Now the fourth line can be read.
Update
The lines
scanf("%*[^\n]s");
should be
scanf("%*[^\n]s\n");
in order to consume the '\n'
as well.