Pierre, Perry and John shared the cost of a gift. The ratio of Pierre's share to the total share of Perry and John was 1 : 4. The ratio of Perry's share to the total share of Pierre and John was 1 : 5. John's share was $169 more than Pierre's share. How much did the gift cost?