A rocket needs 27 tons of fuel for the initial boost and an additional 10 tons for the rest of the journey through space. After an unexpected issue, it needs an extra 2 tons of fuel. How many tons of fuel does the rocket need in total?