  K2-36 is a K dwarf orbited by two small ($R_{\rm b}=1.43\pm0.08$ $R_\oplus$
and $R_{\rm c}=3.2\pm0.3$ $R_\oplus$), close-in ($a_{\rm b}$=0.022 AU and
$a_{\rm c}$=0.054 AU) transiting planets discovered by Kepler/K2. They are
representatives of two families of small planets ($R_{\rm p}$<4 $R_\oplus$)
recently emerged from the analysis of Kepler data, with likely a different
structure, composition and evolutionary pathways. We revise the fundamental
stellar parameters and the sizes of the planets, and provide the first
measurement of their masses and bulk densities, which we use to infer their
structure and composition. We observed K2-36 with the HARPS-N spectrograph over
$\sim$3.5 years, collecting 81 useful radial velocity measurements. The star is
active, with evidence for increasing levels of magnetic activity during the
observing time span. The radial velocity scatter is $\sim$17 \ms due to the
stellar activity contribution, which is much larger that the semi-amplitudes of
the planetary signals. We tested different methods for mitigating the stellar
activity contribution to the radial velocity time variations and measuring the
planet masses with good precision. We found that K2-36 is likely a $\sim$1 Gyr
old system, and by treating the stellar activity through a Gaussian process
regression, we measured the planet masses $m_{\rm b}$=3.9$\pm$1.1 $M_\oplus$
and $m_{\rm c}$=7.8$\pm$2.3 $M_\oplus$. The derived planet bulk densities
$\rho_{\rm b}$=7.2$^{+2.5}_{-2.1}$ $g/cm^{3}$ and $\rho_{\rm
c}$=1.3$^{+0.7}_{-0.5}$ $g/cm^{3}$ point out that K2-36\,b has a rocky,
Earth-like composition, and K2-36\,c is a low-density sub-Neptune. Composed of
two planets with similar orbital separations but different densities, K2-36
represents an optimal laboratory for testing the role of the atmospheric escape
in driving the evolution of close-in, low-mass planets after $\sim$1 Gyr from
their formation.
