If the sum of three consecutive odd integers is p, then in terms of p, what is the greatest of the three integers?