Joe and Tom have 8 marbles and when they put all their marbles together, Joe has 3 marbles. How many marbles does Tom have?