We have calculated the interaction between interstellar matter (mostly hydrogen atoms) flowing into the solar system with the solar wind (mostly protons) emitted from the Sun inside and outside the solar system. We have applied the Boltzmann transport equation and a model of charge exchange collisions between hydrogen and protons in order to determine the distribution function f(r,v,t) of hydrogen atoms in phase space. We calculate the distribution function of hydrogen in one dimension along the solar apex and in two dimensions of velocity space, fH(z,vz,vy,t), by numerical methods. From our computer simulation results, we are able to study 3 populations of hydrogen atoms, resulting from inflow of the interstellar medium or from charge exchange with protons in 3 distinct regions. Our results can be used to improve full fluid models of the structure of the outer solar system.