In a mortifying mistake destined to be cited by gleeful math teachers everywhere, an Oklahoma judge acknowledged that he was three decimal places off — mistaking thousands for millions — when he originally calculated the amount Johnson & Johnson should pay for its role in the state’s opioids crisis.

As a result, Judge Thad Balkman announced on Friday a new fine, reduced by about $107 million. The total is now $ 465 million, down from the $572 million he assessed in August.

The miscalculation came when he was assessing various costs to the state to deal with addiction and prevention issues stemming from opioids. In his August order, Judge Balkman listed the yearly price to train Oklahoma birthing hospitals to evaluate infants with opioids in their systems at $107,683,000.

The amount was actually $107,683.

He was alerted to the mistake by lawyers for Johnson & Johnson, whose accountants did what students have always been urged to do. They checked his math. They counted zeros.