Louis bought 5,577 apples. He gave 1,296 apples to John. Louis then bought another 999 apples. How many apples did Louis have in the end?

5577 - 1296 + 999 = ?