CMIMC 2022 Algebra and Number Theory Division 1 Problem 5

Grant is standing at the beginning of a hallway with infinitely many lockers, numbered, 1,2,3, \ldots All of the lockers are initially closed. Initially, he has some set S=\{1,2,3, \ldots\}.

Every step, for each element s of S, Grant goes through the hallway and opens each locker divisible by s that is closed, and closes each locker divisible by s that is open. Once he does this for all s, he then replaces S with the set of labels of the currently open lockers, and then closes every door again.

After 2022 steps, S has n integers that divide 10^{2022}. Find n.