Mr. Edwards purchased 3 bags of potatoes. He bought 36 potatoes in all. Each bag contains the same number of potatoes. How many potatoes are in each bag?