For people who are trying to lose weight, it does not matter if they are counting carbohydrates, protein or fat. All that matters is that they are counting something.

That is the finding of the largest-ever controlled study of weight-loss methods published on Wednesday in The New England Journal of Medicine. More than 800 overweight adults in Boston and Baton Rouge, La., were assigned to one of four diets that reduced calories through different combinations of fat, carbohydrates and protein. Each plan cut about 750 calories from a participant’s normal diet, but no one ate fewer than 1,200 calories a day.

While the diets were not named, the eating plans were all loosely based on the principles of popular diets like Atkins, which emphasizes low carbohydrates; Dean Ornish, which is low-fat; or the Mediterranean diet, with less animal protein. All participants also received group or individual counseling.

After two years, every diet group had lost  and regained  about the same amount of weight regardless of what diet had been assigned. Participants lost an average of 13 pounds at six months and had maintained about 9 pounds of weight loss and a two-inch drop in waist size after two years. While the average weight loss was modest, about 15 percent of dieters lost more than 10 percent of their weight by the end of the study. Still, after about a year many returned to at least some of their usual eating habits.