6. On the blackboard, there are two positive integers, one is 2002 and the other is a number less than 2002. If the arithmetic mean of the two numbers is an integer $m$, then the following operation can be performed: one of the numbers is erased and replaced with $m$. The maximum number of times such an operation can be performed is ( ).