Usually the maximum length of a period is considered to be 15 days, after which scholars say the woman may perform ghusl and fast and pray. However, in your case you are advised to consult a specialized doctor and inquire about the nature of the blood, and whether it is menstrual blood or another blood named istihadah (continuous bloody discharge). If the doctor confirms that it is menstrual blood, then you have to refrain from fasting and prayer and make up for the missed days later after Ramadan. If the blood is istihadah blood, then you should fast as normal unless you feel that you are not capable of fasting, as in this case there is nothing wrong with breaking your fasting on the basis of sickness. You must make up for it after your recovery.
Dr. Sano Koutoub Moustapha, professor of Fiqh and its Principles at the International Islamic University, Malaysia, states: As a muslim woman witnessing such condition, It is advised to refer to a medical doctor in order to know if your bleeding is menstruation or a sickness called istihadah, which means bleeding similar to menstruation, but it is a sickness that needs further medical treatment. In the event that the medical doctor confirms to you that it is menstruation, then you are not allowed to fast until you are clear from it. Thus a menstruating woman is forbidden to fast or perform salah in the eyes of Islam.
If, on the other hand, your bleeding is found to be istihadah, then you are to fast as normal unless you feel that you don’t have enough energy to fast or you may suffer deeply if you fast. In this case, there is no harm to break your fasting on the basis of sickness and you are to make it up when you recover.
As for the numbers of the days, you shouldn’t be worried about them, as you are going to make them up in the future.