How to count button presses in 5 sec?

How to count button presses in 5 sec?
I want to keep leds blink and count the number of button press in 10 seconds.

for example,
digital pin 1-8 are HIGH then LEDs bright for 10 sec. I must press the button for 8 times within 10 sec.

If the number of button press is equal to 8 digital pin 10 is HIGH, not equal to 8 digital pin 11 is HIGH.

How to do like this?
Regards

How to count button presses in 5 sec?
I want to keep leds blink and count the number of button press in 10 seconds.

"Keep leds blink" doesn't make sense. "Keep leds blinking" might. Which LEDs? How are they made to blink?

Something like this shows how to count the presses in 10 seconds. Other stuff, like turning LEDs on or off can be done in the while loop.

void loop()
{
   digitalWrite(8, HIGH); // Turn pin 8 on
   unsigned long startTime = millis(); // Capture current time

   int cnt = 0;
   while(millis() - startTime < 10000) // Loop for 10 seconds
   {
       if(digitalRead(switchPin) == HIGH) // Or LOW, depending on how the switch is wired
       {
          cnt++; // Increment counter
          delay(10); // Wait for 10 microseconds to avoid bouncing switch issue
      }
   }

   // Time is up
   if(cnt == 9)
   {
       digitalWrite(10, HIGH);
       digitalWrite(11, LOW);
   }
   else
   {
       digitalWrite(10, LOW);
       digitalWrite(11, HIGH);
   }
}

Thank you for your help.
It's work!