LCD using INT0

Hello I’m trying to count how many times the interrupt has been executed here is my code it freezes when i push button I dont know anything about flags BTW any suggestions ? …

#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <avr/io.h>
#include <avr/interrupt.h>// allways include if using interrupts
#include <util/delay.h>
#define F_CPU 8000000
#define Delay 15
#define cycles 100
LiquidCrystal_I2C lcd(0x27,16,2);

//-ISR-****
ISR(INT0_vect)
{
for(int i=0;i<=50;i++)
{
_delay_ms(20);
PORTB=0x1;
_delay_ms(20);
PORTB=0x0;
_delay_ms(20);
PORTA=0x1;
_delay_ms(20);
PORTA=0x0;

}

}
//*******END_OF_ISR

int main(void)
{

DDRA=0x1;
DDRB=0x1;
sei();//global interrupt enable

GICR |= (1<<INT0);//turn on INT0
MCUCR =(1<<ISC01 | 0<<ISC00);// interrupt on rising edge

//setup data ports
DDRB=0x1;

while(1)
{
_delay_ms(500);
PORTB=0x1;
_delay_ms(500);
PORTB=0x0;

}
}

I have deleted the code that freezes this is the base of it thoe

just blinks an LED I want to update the LCD with every button press the program works great until i try to use LCD when I add the code for it it freezes HMMM? dont know why

(deleted)

ISR(INT0_vect)
{
  for(int i=0;i<=50;i++)
  {
  _delay_ms(20);
  PORTB=0x1;
   _delay_ms(20);
  PORTB=0x0;
   _delay_ms(20);
  PORTA=0x1;
   _delay_ms(20);
  PORTA=0x0;
  
  }

A 4 second long ISR is NEVER a good idea. You should just set a flag and let loop do this part.