The production of four top quarks (tt¯tt¯) is studied with LHC proton-proton collision data samples collected by the CMS experiment at a center-of-mass energy of 13 TeV, and corresponding to integrated luminosities of up to 138fb−1. Events that have no leptons (all-hadronic), one lepton, or two opposite-sign leptons (where lepton refers only to prompt electrons or prompt muons) are considered. This is the first tt¯tt¯ measurement that includes the all-hadronic final state. The observed significance of the tt¯tt¯ signal in these final states of 3.9 standard deviations (1.5 expected) provides evidence for tt¯tt¯ production, with a measured cross section of 36−11+12fb. Combined with earlier CMS results in other final states, the signal significance is 4.0 standard deviations (3.2 expected). The combination returns an observed cross section of 17±4(stat)±3(syst)fb, which is consistent with the standard model prediction.