Healthy nutrition promotions and regulations have long been regarded as a tool for increasing social welfare. One of the avenues taken in the past decade is sugar consumption regulation by introducing a sugar tax. Such a tax increases the price of extensive sugar containment in products such as soft drinks. In this article we consider a typical problem of optimal regulatory policy design, where the task is to determine the sugar tax rate maximizing the social welfare. We model the problem as a sequential game represented by the three-level mathematical program. On the upper level, the government decides upon the tax rate. On the middle level, producers decide on the product pricing. On the lower level, consumers decide upon their preferences towards the products. While the general problem is computationally intractable, the problem with a few product types is polynomially solvable, even for an arbitrary number of heterogeneous consumers. This paper presents a simple, intuitive and easily implementable framework for computing optimal sugar tax in a market with a few products. This resembles the reality as the soft drinks, for instance, are typically categorized in either regular or no-sugar drinks, e.g. Coca-Cola and Coca-Cola Zero. We illustrate the algorithm using an example based on the real data and draw conclusions for a specific local market.