A box of candy was divided into three bottles P, Q and R in the ratio 9:4:11. If, instead, the candy had been divided equally between them, there would be 21 fewer pieces of candy in bottle R. How many pieces of candy were there in the box?​