  Let $\Omega \subset \mathbb{R}^d$, $d \geq 2$, be a bounded convex domain and
$f\colon \Omega \to \mathbb{R}$ be a non-negative subharmonic function. In this
paper we prove the inequality \[ \frac{1}{|\Omega|}\int_\Omega f(x)\,dx \leq
\frac{d}{|\partial\Omega|}\int_{\partial\Omega} f(x)\,d\sigma(x)\,. \]
Equivalently, the result can be stated as a bound for the gradient of the Saint
Venant torsion function. Specifically, if $\Omega \subset \mathbb{R}^d$ is a
bounded convex domain and $u$ is the solution of $-\Delta u =1$ with
homogeneous Dirichlet boundary conditions, then \[ \|\nabla
u\|_{L^\infty(\Omega)} < d\frac{|\Omega|}{|\partial\Omega|}\,. \] Moreover,
both inequalities are sharp in the sense that if the constant $d$ is replaced
by something smaller there exist convex domains for which the inequalities
fail. This improves upon the recent result that the optimal constant is bounded
from above by $d^{3/2}$ due to Beck et al.
