Suppose that N can be written in base 6 as 5313406 and in base 8 as 1241548. In base 10, what is the remainder when N is divided by 210?