You should first ask for the number of lines, verify that input is indeed a valid integer, and store it in a counter.
Then, a loop which would execute the desired number of lines.
int count;
while (!int.TryParse(Console.ReadLine(), out count));
int i = 0;
while (i < count) {
}
Hope this helps. Kindly.