  Higher-order topological insulators host gapless states on hinges or corners
of three-dimensional crystals. Recent studies suggested that even topologically
trivial insulators may exhibit fractionally quantized charges localized at
hinges or corners. Although most of the previous studies focused on
two-dimensional systems, in this work, we take the initial step toward the
systematic understanding of hinge and corner charges in three-dimensional
insulators. We consider five crystal shapes of vertex-transitive polyhedra with
the cubic symmetry such as a cube, an octahedron and a cuboctahedron. We derive
real-space formulas for the hinge and corner charges in terms of the electric
charges associated with bulk Wyckoff positions. We find that both the hinge and
corner charges can be predicted from the bulk perspective only modulo certain
fractions depending on the crystal shape, because the relaxation near
boundaries of the crystal may affect the fractional parts. In particular, we
show that a fractionally quantized charge $1/24$ mod $1/12$ in the unit of
elementary charge can appear in a crystal with a shape of a truncated cube or a
truncated octahedron. We also investigate momentum-space formulas for the hinge
and corner charges. It turns out that the irreducible representations of filled
bands at high-symmetry momenta are not sufficient to determine the corner
charge. We introduce an additional Wilson-loop invariant to resolve this issue.
