A box has p sheets of writing paper and two-thirds as many envelopes. If there are a total of 500 sheets of paper and envelopes together, how many envelopes are there?