Answer is 255
  1. on 1st gate he will give 128
  2. on 2nd gate he will give 64
  3. on 3rd gate he will give 32
  4. on 4th gate he will give 16
  5. on 4th gate he will give 8
  6. on 6th gate he will give 4
  7. on 7th gate he will give 2
finally 1 orange will remain with him.