We present a new automatic method that can be used for identification of both boundaries if several criteria are fulfilled: 1) available magnetic field and plasma data from a solar wind monitor, and 2) measurements of the magnetic field and plasma density from a sounding spacecraft. We used one-minute medians of continuous measurements of these parameters by a particular spacecraft and distinguished three regions – the solar wind, the magnetosheath, and the ihned magnetosphere – according to the magnetic field and plasma density ratios.