Halloween was almost over, and Mr. Kandala had less than 20 candies left. When the doorbell rang, he thought he would give all the candies away. When he opened the door, there were two trick or treaters. He wanted to give away the candies evenly, but he noticed that when he divided the candies in two, there was one left over. At that point, he saw another trick or treater behind the first two. He tried to divide the candies evenly among the three of them, but again one was left over. Finally, another trick or treater came to his door, making it four trick or treaters altogether. Mr. Kandala still had one candy left over after dividing the left over candies in fours.
How many candies did Mr. Kandala have left when the doorbell rang?