Example 2 Let $m, n$ be positive integers, $m<2001, n<$ 2002, and there are $2001 \times 2002$ different real numbers. Fill these numbers into the squares of a $2001 \times 2002$ chessboard so that each square contains exactly one number. If a number in a square is less than at least $m$ numbers in its column and also less than at least $n$ numbers in its row, then this square is called a "bad square". For each way of filling the numbers, find the minimum value of the number of bad squares $S$.
(2002, Vietnam Mathematical Olympiad)