How many times is JOB_FAIL event triggered in case of retries

I am planning to write an event handler to handle failed jobs I see that I can trap these by using JOB_FAIL flag in HistoryEventTypes class. By default the engine retries a task 3 times from the last checkpoint if a job fails. If I write the handler will it be called 3 times if the engine does 3 retries or will one event be passed at the end of the 3rd retry?