Can i use timer 5 in arduino mega (pin 46,45,44) to count an external pulse

Need help,
I am doing a project in which i need to count an external pulse generated from an astable 555 timer circuit. The Arduino mega should count 300 pulses after that only my program should be executed. can i do it without using interrupts ... ? Can i use the timer 5 ...?
thank you...

I think that if the frecuency is not too high, a simple while loop can do the job, just increment a variable each time and when it reach to 300 break the while loop.

using a Push button switch to test the code is a bad idea as it can make a lot of noisy pulses trigering in wrong form the arduino logic.

hope this helps

Thank you sir.
i understand that the i can use a while loop. The counting to be done is 300 min, one count (pulse) for one min. i want to use an external pulse from a multivibrator circuit, is this possible sir. As i am a beginner to arduino i am not so clear with timers.

A while loop is not required, the loop() function is called over and over again. What you have to do is polling the input pin, and increment a counter variable with every change of the pin state, e.g. from LOW to HIGH. Add an if-statement, that starts the rest of your program, once the counter reaches 300 counts. If that part of the program should run only once, reset the counter or set a flag, to prevent more than one execution.