This is the cleanest application of ideas from [1196] solution with sub-Markov chains. However I couldn't make it in one prompt, and the following note is a messy result of back-and-forth with multiple instances of GPT-5.4 Pro.
The main result is the estimate
together with some compute around it. If one cares only about the asymptotic result, then the proof can be significantly shortened as the arguments are easier asymptotically. I probably put that out too, and I'll work on formalization. I wanted to share the longer note, because I think ideas there are interesting.
EDIT: Here's a streamlined argument just for the asymptotic part (and even more streamlined version here with sub-Markov chain argument made more elementary). Formalization by Aristotle of this streamlined argument is here. It formalizes sub-Markov chains/dynamic programming well, and leaves 2 sorries for Mertens and one analytic result (but informal proofs are given by Aristotle too).