If I have a long bike ride during the day, I drink a 4th cup of full-caf.
Still sleep like a baby.
I read somewhere that the half-life of caffeine is around 5 hours. If you are letting 5 or more hours elapse after your last cup it should not keep you awake. 5-Hour energy drinks have about the same caffeine as coffee, hence the name.