  We examine the variational problem in Lovelock gravity when the boundary
contains timelike and spacelike segments nonsmoothly glued. We show that two
kinds of contributions have to be added to the action. The first one is
associated to the presence of a boundary in every segment and it depends on
intrinsic and extrinsic curvatures. We can think of this contribution as adding
a total derivative to the usual surface term of Lovelock gravity. The second
one appears in every joint between two segments and it involves the integral
along the joint of the Jacobson-Myers entropy density weighted by the Lorentz
boost parameter which relates the orthonormal frames in each segment. We argue
that this term can be straightforwardly extended to the case of joints
involving null boundaries. As an application, we compute the contribution of
these terms to the complexity of global AdS in Lovelock gravity by using the
"complexity = action" proposal and we identify possible universal terms for
arbitrary values of the Lovelock couplings. We find that they depend on the
charge $a^*$ controlling the holographic entanglement entropy and on a new
constant that we characterize.
