Lavanya has to complete $12$ courses for her degree. There are six compulsory courses: Basic and Advanced Mathematics, Basic and Advanced Physics and Basic and Advanced Electronics. She also has to complete six Optional Courses. Each course takes one semester to complete. There are some constraints because of prerequisites.
- For Mathematics, Physics and Electronics, the Basic course must be completed before starting the Advanced course.
- Advanced Physics must be completed before starting Basic Electronics.
- Advanced Mathematics must be completed before starting Advanced Physics.
- The Optional Courses can be done in any order, but no more than two Optional Courses can be taken in a semester
Given these constraints, what is the minimum number of semesters that Lavanya needs to complete her course requirements.