A can do a piece of work in 60 days, which B can do in 40 days. Both started the work but A left 10 days before the completion of the work. The work was finished in how many days?