The Apple Transport Puzzle II

The Apple Transport Puzzle II
StrategyHard

A truck driver has been tasked with transporting 3000 apples between towns A and B, which are 1000 miles apart. However, while there are apples in his truck, the truck driver will eat them at a rate of 1 apple per mile. If there are no apples he won't drive. The truck has a maximum capacity of 1000 apples at any one time. The driver may deposit and load as many apples as he wants at any point between A and B.

Question: What is the maximum number of apples he can bring over to B?