Shedding is a normal part of the process of treating hair loss. The hair that sheds out usually grows back thicker than it was before. You need to ride it out if you can handle the emotional roller coaster ride. If cannot ride it out and decide to quit the treatment, you need to accept that the hair that has shed out will probably be lost for good.
You do need to know that neither Minoxidil or Finasteride are appropriate for treating the hair line in males. Most males are genetically programmed to loose a certain amount of hair from their hair lines as they mature into adults, particularly in the temples. Attempting to prevent this natural and normal development can accelerate this process thereby making it happen sooner than it would have if you had left it alone. You have already started, so you need to stick with it in order to have a reasonable chance of gaining any of the hair that has shed out back.
You need to stick with these treatments for at least a full 12 to 18 months before you will know if they are helping you or not.