Text this: Optimal information gain at the onset of habituation to repeated stimuli