How to set optimal exposure times before creating HDR image?

I am going to take five photos and combine those into an HDR-image. How do I calculate/chose the optimal exposure times to create the best HDR-image? And how to chose number of images to use? I have read some articles but just this topic is rarely touched upon.