Optimizing the Number of States, Training Iterations and Gaussians in an HMM-based Handwritten Word Recognizer