The interaction of the shocked solar wind and the planetary ions at Mars