1. The problem statement, all variables and given/known data 2. Relevant equations $$W=-\int PdV$$ 3. The attempt at a solution The gas fills the cylinder slowly and any increase in pressure of system is countered by the upward motion of piston. So the process is quasi-static. But how do I find final amount of gas in the cylinder?