e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Competitions

Math functions

f91

McCarthy is a famous theorician of computer science. In his work, he defined a recursive function, called f91, that takes as input a positive integer n and returns a positive integer defined as follows:

If n100, then f91(n) = f91(f91(n + 11));

If n101, then f91(n) = n - 10.

Input

A positive integer n not greater than 1000000.

Output

The value of f91(n).

Time limit 1 second
Memory limit 64 MiB
Input example #1
91
Output example #1
91