36. How long will it take to get out of the well?

- As you wish, - agreed Quasi-Tortoise. I'll tell you a problem about a frog that fell into a well.
- But that's a very old problem! - objected the Griffin. - It has a very long beard! Don't you know any new problems?
- I haven't heard this problem, - Alice spoke up for Quasi-Tortoise.

![](https://cdn.mathpix.com/cropped/2024_05_21_5afa4e43618f5800e92dg-055.jpg?height=837&width=851&top_left_y=1018&top_left_x=634)

- Alright, - agreed the Griffin, yawning. - We'll do it this way. You tell your problem to Alice, since she hasn't heard it, and I'll take a little nap. Only one condition: wake me up when you're done. Agreed?

The Griffin curled up comfortably and dozed off, while Quasi-Tortoise told Alice the old problem about the frog.

- One morning, a frog fell into a well that was thirty feet deep. During the day, climbing up the walls, it climbed three feet, and at night, while sleeping, it slipped back two feet.

How many days will it take for the frog to get out of the well?
36. How long does it take to get out of the well? Those who think the frog will get out of the well in 30 days are wrong: the frog could have gotten out of the well by evening on the 28th day. Indeed, in the morning of the 2nd day, the frog is 1 foot above the bottom of the well, in the morning of the 3rd day - 2 feet, and so on. Finally, in the morning of the
$28-$th day, the frog is 27 feet above the bottom of the well. By evening of the same day, it will reach the top and climb out of the well, after which it will no longer have to slide back down.