Most police forces around the world would shudder at the thought of guaranteeing the safety of 50 million pilgrims as they bathe in a narrow stretch of river.
The Kumbh Mela festival, which concludes on April 28, is a disorderly, dirty and occasionally dangerous gathering of Hindu pilgrims on the banks of the fast-flowing river Ganges in northern India.
Over three months, devotees stream onto ghats, or bathing steps, at a site that lacks everything from roads and parking to toilets and accommodation. The pilgrims believe the holy bath cleanses them of sin.
Thousands of families bed down in the streets, children get separated from their parents, elderly relatives fight to stay upright in the thrusting crowds, and tourists search desperately for bottled water and clean food.
But behind the apparent anarchy is a complex organisational plan to keep the festival running in surprisingly smooth and good-humoured manner as devotees go back and forth for their bathes in the sacred river.
"Managing a crowd of tens of millions of people is a mammoth task," Alok Sharma, the senior police officer in charge of the festival, told AFP at his office next to the Ganges in Haridwar city -- this year's Kumbh Mela venue.
"Everywhere around here is packed with mankind," he said. "The threat of stampedes with such numbers is great. It is a massive human control exercise.
"People try to all converge in one small place at the same time, which presents a very difficult task. We try to make people go to different ghats instead."
Sharma uses hundreds of closed-circuit television cameras to monitor pressure points, ordering officers on the ground to divert crowds into long queueing systems or shutting off routes all together.
He said 20,000 officers have been recruited from across India to oversee the Kumbh Mela, which has already attracted more than 50 million pilgrims.
One impressed observer was Andreas Manthur, a retired police officer from Germany fulfilling a lifetime's ambition to see the event for himself.
"It is so crowded, and the Indian police don't have a good reputation, but I think they are doing an effective job," he said. "They are very firm rather than nasty. There is clearly a plan in place and they are implementing it."
Last Wednesday was the biggest bathing day of the Kumbh Mela, which was marred by the death of seven people in a car crash and stampede, a tragedy that might have overshadowed a smaller festival.
Organisers said that 16 million people took to the chilly waters on that day alone -- though some observers suggest such figures are exaggerated.
Details about the accident are unclear, but most reports say a car ploughed into a crowd on a bridge triggering a stampede.
At Har Ki Pauri, the most important of the 187 ghats, police armed with sticks constantly chivvy along any pilgrims who take too long immersing themselves in the sacred water or putting their clothes back on afterwards.
Riot police and commandos are also on guard, especially when the ghat must be cleared of normal pilgrims for the naked, ash-smeared "sadhus" or holy men, to lead bathing on the four most auspicious days of the festival.
Key to preventing stampedes -- hundreds were crushed to death underfoot in 1954 and dozens also died in 2003 -- is the control of the crossing points along the 15-kilometre (nine-mile) stretch of the Ganges.
All 45 bridges are guarded by police who enforce a strict one-way system for the excited but exhausted pilgrims as they walk in a constant dense tide between the river and wherever they are sleeping.
Dams upstream also regulate the river's flow, keeping water at its safest height on the most popular holy days.
Alongside the official plan with its closed-circuit televisions and armed police, there is a more traditional network imposing some order on the chaos.
The myriad of different Hindu branches and sects from across India divide up the 130 square kilometre (50 square mile) festival grounds, providing huge colourful tents, mass feeding sessions and religious teachings for pilgrims.
Most visitors plan their trip months in advance, and travel in large family or village groups, staying with familiar gurus (teachers) and among fellow devotees they know.
More than 800 religious groupings are officially represented at the festival.
"We are staying far away from the river with a group who all follow the same leader," said D.K. Panda, 34, from West Bengal. "It is my first time, but our lot are well-organised and has experienced people in it.
"This is not about comfort, it is about being here. It is a very deep feeling and I believe I am safe."
The Kumbh Mela ("Pitcher Festival") is held every three years and rotates around the four cities where, in Hindu mythology, drops of the nectar of immorality fell from a pitcher during a struggle between the gods and demons.
Whatever the challenges of this year's gathering, which ends on April 28, they will be dwarfed by the next event in 2013.
To be held in Allahabad -- always the biggest Kumbh Mela venue -- the last festival there in 2001 is often described as the largest human gathering ever after attracting more than 70 million people over just six weeks.