A snail is at the bottom of a bucket which is 40cm high. The snail climbs at the rate of 10cm every 50minutes. After every 50min climb the snail rests for 10mins. During the rest, the snail slips down one tenth of the total distance that he has climbed from the bottom of the bucket. How long will it take him to climb out of the bucket?