A measurement is performed of the cross section of top quark pair production in association with a W or Z boson using proton-proton collisions at a center-of-mass energy of 13TeV at the LHC. The data sample corresponds to an integrated luminosity of 35.9 fb(-1), collected by the CMS experiment in 2016. The measurement is performed in the same-sign dilepton, three-and four-lepton final states. The production cross sections are measured to be sigma(t (t) over barW) = 0.77(-0.11)(+0.12)(stat)(-0.12)(+0.13) pb and sigma(t (t) over barZ) = 0.99(-0.08)(+0.09) (stat)(-0.10)(+0.12) (syst) pb. The expected (observed) signal signi fi cance for the sigma(t (t) over barW production in same-sign dilepton channel is found to be 4.5 (5.3) standard deviations, while for the t (t) over barZ production in three- and four-lepton channels both the expected and the observed signi fi cances are found to be in excess of 5 standard deviations. The results are in agreement with the standard model predictions and are used to constrain the Wilson coe ffi cients for eight dimension-six operators describing new interactions that would modify t (t) over barW and t (t) over barZ production.