ANSWER:

If the period comes even a few seconds before Maghrib, your fast of that day is not valid and you must make it up 

QUESTION: If we want to fast the 6 days of shawwal we have to complete the missed fasts of Ramadan so my question is my 3 fasts were missed due to periods but I got my periods 3-4 minutes before iftar so do I have to count that fast also and complete 6 fast shawwal + 4 fast of missed fast Or I have to keep 3 fasts that were missed with 6 fasts of shawwal