In a kingdom,there was only one Mango tree left. The tree was in the middle of 7 concentric high walls having gates guarded by soldiers. A thief decides to steal the mangoes. But before entering the thief makes a deal with all the seven soldiers that whatever number of mangoes he plucks from the tree, he has to divide them equally between every soldier and take one extra mango from everyone. For example, he has 10 mangoes, he has to give 5 to the first soldier and take 1 extra that accounts to 6 and the pattern goes on till the last soldier. Hence how many mangoes he has to pluck from the tree so that he has 2 mangoes left with him after he crosses all the 7 gates?