A, B and C can complete a piece of work in 16, 32 and 48 days, respectively. They started working together but C left after working 4 days and B left 2 days before the completion of the work. How many days it took in total to complete the work?