What are great forty?
In one of (R.1.1) right view, wrong view (W.1.1) is abolished and the many evil unwholesome states (W.1.2) that originate with wrong view as condition are also abolished, and the (R.1.2) many wholesome states that originate with right view as condition come to fulfilment by development .... In one of (R.10.1) right deliverance, wrong deliverance (W.10.1) is abolished, and the many evil unwholesome states (W.10.2) that originate with wrong deliverance as condition are also abolished, and the (R.10.2) many wholesome states that originate with right deliverance as condition come to fulfilment by development.


  Thus, bhikkhus, there are twenty factors on the side of the
  wholesome and twenty factors on the side of the unwholesome.


10 right factors + 10 wholesome states originating from 10 right factors + 10 wrong factors + 10 unwholesome states originating from 10 wrong factors = 40