Martha gave James 5 + 2 = <<5+2=7>>7 apples.
So Martha was left with 20 - 5 - 7 = <<20-5-7=8>>8 apples.
To be left with only 4 apples, Martha would need to give away 8 - 4 = <<8-4=4>>4 more apples.
#### 4