At first, a container contained 4 purple balls and some grey beads. After some purple balls were added, 58 of the balls were grey. After 42 yellow balls were added to the container and now, 511 of the beads were grey. What was the number of purple balls added?