Lewis Hamilton finished in the points at the Italian Grand Prix despite suffering from a five-place grid penalty.