We verify a special case of V. V. Shokurov's conjecture about characterization of toric varieties. More precisely, we consider
three-dimensional log varieties with only purely log terminal singularities and numerically trivial log canonical divisor. In this situation we prove an inequality connecting the rank of the group of Weil divisors modulo algebraic equivalence and the sum of coefficients of the boundary. We describe such varieties for which the equality holds and show that all of them are toric.