At first, a container contained 4 blue balls and some black beads. After some blue balls were added, 310 of the balls were black. After 30 red balls were added to the container and now, 313 of the beads were black. What was the number of blue balls added?