Work Efficiency

Machine A can complete a batch of wafer processing in 8 hours. Machine B can do the same job in 12 hours. If both machines are turned on simultaneously, but Machine A is shut down 2 hours before the processing is complete, how many total hours did the processing take?