A search for the standard model production of four top quarks (pp tttt) is reported using single-lepton plus jets and opposite-sign dilepton plus jets signatures. Proton-proton collisions are recorded with the CMS detector at the LHC at a center-ofmass energy of 13 TeV in a sample corresponding to an integrated luminosity of 35.8 fb-1. A multivariate analysis exploiting global event and jet properties is used to discriminate tttt from tt production. No significant deviation is observed from the predicted background. An upper limit is set on the cross section for tttt production in the standard model of 48 fb at 95% confidence level. When combined with a previous measurement by the CMS experiment from an analysis of other final states, the observed signal significance is 1.4 standard deviations, and the combined cross section measurement is 13+911 fb. The result is also interpreted in the framework of effective field theory.