Cooperation and defection may be considered to be two extreme responses to a social dilemma. Yet the reality is much less clear-cut. Between the two extremes lies an interval of ambivalent choices, which may be captured theoretically by means of continuous strategies defining the extent of the contributions of each individual player to the common pool. If strategies are chosen from the unit interval, where 0 corresponds to pure defection and 1 corresponds to the maximal contribution, the question is what is the characteristic level of individual investments to the benefit functions, and we show that in a structured population there exist intermediate values of both at which the collective contributions are maximal. However, as the cost-to-benefit ratio of cooperation increases, the characteristic threshold decreases while the corresponding steepness increases. Our observations remain valid if more complex sigmoid functions are used, thus reenforcing the importance of carefully adjusted benefits for high levels of public cooperation.