Proof of a conjecture on word complexity