DIVIDE, Mont. (AP) — The school day in Divide begins with the four students, ages 5 to 14, reciting the Pledge of Allegiance around the flagpole outside their little red schoolhouse on the outskirts of the southwestern Montana ranching town, population 161.

When they finish, all four sit at desks in the school’s one classroom before teacher Judy Boyle, who switches between elementary and middle school lesson plans. Throughout the day, Boyle will also be their nurse, principal, counselor and administrator.

“It’s not the way of the world to separate the disciplines,” Boyle said.

Divide School and 60-some schools like it in Montana are still used to educate the small population of rural students, who are isolated from towns by weather and geography. A tribute to a less mobile and more agricultural past, operating schoolhouses like Divide are far and few between.

National Rural Education Association Executive Director John Hill said these schools are fading fast. He estimates there anywhere between 400 and 700 schoolhouses left in the nation.

Most of these schoolhouses are dotted across western rural communities, and Montana is home to more than any other state.

Increased urbanization due to the recession makes it harder for some of these schools to justify keeping their doors open. Enrollment is shrinking with rural population decline, raising pressure to consolidate or close. Some rural schools are operating on a bare-bones budget, which means low pay for teachers and little money left over for the curriculum.

But small school administrators, rural towns and teachers hold onto their schools, arguing the venues offer superior education in part because of their small size. They also fear that with the closure of the school, the rural community will go with it.

At Divide School, enrollment has shrunk over the years, and classes are now held in one of the two classrooms. The other room contains a small library, art supplies and an impressive hydroponic system that feeds a number of blossoming vegetable and flower plants.

With federal grant money from the Rural Education Achievement Program, the small school is able supplement its curriculum with things like the garden, laptops for every child and weekly technology lessons.

The small class numbers also cater to the individualized student needs in a way a bigger school could only dream about, said Cathy Maloney, Butte Silverbow County Superintendent of Schools who began her career teaching at Divide. She called rural schools Montana’s “unknown treasures.”

Next year the enrollment for Divide will increase to six students, but another school within her district won’t be so lucky, she said.

Five years ago, Melrose, population 90, had 18 students enrolled in their school. This year, the four-room school building has shrunk to one operating classroom and the enrollment is down to two students. Next year that school will serve a student population of one. “They are caught in the tide of changing times,” Maloney said.

The recession has forced many families to pack up and move closer to larger towns like Butte or Dillon for work. And family ranches are now being bought by rich fly-fishing enthusiasts, who only come a few times a year to fish the picturesque Big Hole River and bring no children with them, Melrose teacher Roxie Bulen said.

Bulen, who came from teaching larger schools in Minnesota, praised the small-school education, saying students can’t fall through the cracks and that teachers, familiar with students’ weaknesses and strengths, can mold their teaching styles to serve the varying needs of their students, she said.

But if the student population doesn’t grow, the future of Melrose School — and the community of Melrose — is uncertain.

“I think having the school is the only way for the community to grow,” Bulen said.

Polaris School is another historic schoolhouse. It sits at the base the Pioneer Mountains in rural southwest Montana. The one-room schoolhouse sits alone on a windy, scenic byway with a few mailboxes and even fewer buildings dotting the road. There’s no cellphone service, and there’s no town. Yet the small ranching community produces enough children for the school to educate, and currently, like Divide, that number is four.

School teacher Amanda Schrepfer is following the trend of urbanization. She and her husband will move closer to Dillon to have their third child, taking half the student population — their two children — with them. She said the school will stay open and they anticipate up to five students next year.

If it closes, it will mean an hour commute for the remaining students, she said.