The problem of estimating the Minkowski content L0(G) of a body G ⊂ ℝd is considered. For d = 2, the Minkowski content represents the boundary length of G. It is assumed that a ball of radius r can roll inside and outside the boundary of G. We use this shape restriction to propose a new estimator for L0(G). This estimator is based on the information provided by a random sample, taken on a square containing G, in which we know whether a sample point is in G or not. We obtain the almost sure convergence rate for the proposed estimator.