The Spanish education system offers various types of education from infant school through university. Primary education is compulsory and free in state schools from ages 6 to 12. Secondary education is then compulsory from ages 12 to 16 and offers vocational training options. Students can pursue a non-compulsory high school program (Bachillerato) from ages 16 to 18 to prepare for the university entrance exam (PAU) or vocational training. University studies typically last 4 years but some like medicine take 6 years, and credits (ECTS) are earned to obtain degrees.