Stephen de las Heras / Getty Images

Say you're a college student who was recently dumped by the person you thought was the One. You're moping around campus in your I've-given-up sweatpants and eating crappy comfort food when you come across a flyer seeking people who are still pining for their exes. You think, at last, someone to talk to!

Well, not exactly. When about 15 sad sacks responded to the flyers, which had been distributed around the State University of New York at Stony Brook and Rutgers University, they discovered they were actually being invited to take part in a psychological study: researchers wanted to gauge the kind of pain felt by people on the business end of a breakup. (See pictures of Elizabeth Taylor's tumultuous love life.)

Each jilted student was hooked up to a functional magnetic resonance imaging (fMRI) scanner and asked to look at a picture of his or her ex (which  oh, the indignity!  the dumpees had to provide themselves). After looking at the photos, they were asked to count backward from 8,211 by 7s, then look at another picture of a person they knew but were not in love with, then count backward again. As if that exercise wasn't agonizing enough, the participants had to do it five more times.

Lucy Brown, professor of neuroscience and neurology at Albert Einstein College of Medicine, acknowledges it wasn't an easy task. "We're asking them to think about the person they want to see more than anyone else. And then we're asking them not to feel that feeling," she says, referring to the backward-counting task, which was a distraction technique designed to get students' brains to focus on something other than the no-good bums who dumped them.

Meanwhile, scientists were using fMRI to track the participants' brain activity as they looked at the emotionally loaded photos. As any reader of mass-market romance novels could probably tell you, the brain areas associated with the pain of romantic rejection were the same ones involved in reward, motivation, physical pain, craving and addiction. (For instance, looking at photos of exes lit up regions that are activated in cocaine addicts' brains  which may help explain quite a lot of the plot of those Twilight books.)

It also helps explain why feelings of heartbreak are so hard to get over and even harder to control. The study notes, with classic academic rigor, that the spurned students had engaged in activities such as "inappropriate phoning, writing or e-mailing, pleading for reconciliation, sobbing for hours, drinking too much and/or making dramatic entrances and exits into the rejecter's home, place of work or social space to express anger, despair or passionate love." Sound familiar, anyone?

At least in one sense, this pain is a good thing, according to Brown. "In a way, nature gave us this response as a protection," she says. "It helps us keep relationships going under adverse circumstances, which is important for keeping our species going."

Plus, in some cases, students were already undergoing reappraisal success, which is neurological-speak for remembering the less convivial aspects of an ex  the first step in getting over him or her.

Let's hope that news was worth the ordeal for the study's guinea pigs, who had been single for an average of 63 days, after relationships that lasted an average of 21 months. (One had been going for four years. Ouch.)

Still, there's no getting around the fact that breakups hurt. Helen Fisher, the renowned biological anthropologist and one of the paper's co-authors, interviewed some of the participants and said that even she found their pain distressing. "She said she'd never want to do it again," says Brown, who nevertheless hopes her experiment will be repeated with a bigger set of spurned lovers. (She knows a divorce counselor who might be able to hook her up.)

But Brown thinks it's helpful for people to know that breaking up is supposed to hurt. "One guy called back the next day and said he thought the self-knowledge really helped," she says.

By the way, for those trying this at home, that counting-back-by-7s-from-8,211 technique may help you forget your ex, but only for about a minute. In dire cases, you might want to try long division.

See TIME's Pictures of the Week.