Fix the logic of paper number accounting