Given,
The mass of the car that is moving due east, m₁=3000 kg
The speed of the car that is moving due east, v₁=50 m/s
The mass of the car that is moving due west, m₂=5000 kg
The mass of the car that is moving due west, v₂=-40 m/s
Here we consider the east as the positive direction and the west as the negative direction. That is why the velocity of the car moving west is a negative quantity.
The momentum of an object is the product of the mass and the velocity of the object.
Thus the total momentum of the two objects is given by,

On substituting the known values,

Therefore the total momentum of both vehicles is -50000 kg·m/s
The negative sign indicates that the momentum vector is directed westwards.