In 1879, San Francisco had 15 grammar schools, three exclusively for girls, three exclusively for boys, and nine co-educational. In addition, co-ed Potrero School served both primary and grammar pupils. Students expected to attend grammar school for seven or eight years.