Business ideas are often hatched in unlikely places. But for Atsushi Nakanishi, an epiphany could not have hit him at a worse time.

On a fateful day in September 2013, Nakanishi, then a student at the University of California, Berkeley, was in the middle of moving house. He was hurriedly walking down the street, carrying carts full of luggage, when he felt the unexpected, unstoppable urge to, ahem, poo.

“It just happened,” he recalled recently at his office in Shibuya, Tokyo, noting that he had been trying to tame an uneasiness in his stomach that day after having spicy noodles for breakfast. “As I was walking, I was thinking I could wait to go to the toilet for 15 more minutes, because I couldn’t find one nearby, until I could get to the house I was moving into. But then my determination wavered when I saw a store. For a second, I thought the store might let me use its bathroom.”