The answer is 4.

**
This section requires Javascript.
**

You are seeing this because something didn't load right. We suggest you, (a) try
refreshing the page, (b) enabling javascript if it is disabled on your browser and,
finally, (c)
loading the
non-javascript version of this page
. We're sorry about the hassle.

If a box's number is $k$ , then it will change, when a person's ID is a divisor of $k$ . A box will be open at the end if and only if it changes an odd number of times, ie. the box number has odd number of divisors. If a number has odd number of divisors, then it is a perfect square. The perfect squares at most 20 are 1,4,9,16.

Therefore the answer is $\boxed{4}$ .