We know that he took out Rs.5000 from the bank and that he took 40 of the 50 Rupees notes. We have to subtract to find the amount he took in 20 Rupees notes and then divide by 20 to find the number. 40*50 = 2000 and 5000 - 2000 = 3000. After that, 3000/20 = 150, so that means that Mr. Dey took out 150 notes of 20 rupees.