Fractions are better when continued
시간 제한1초메모리 제한1024 MB
N이 최대 40일 때, 1에서 시작해 1/(1+...)을 N번 겹쳐 만든 유한 연분수 p_N의 분자를 구한다.
문제
Little Charles was one of the best competitive programmers in the world. However, he never really liked programming. Now that he is retired, he can dedicate his studies to what he really loves: continued fractions.
To prepare for the upcoming Imensa Competição de Phrações Contínuas (ICPC), he needs to solve the following problem:
Define as the level fraction. Then define: as the level fraction, . And also, as the level fraction, , and so on.
Given an integer value , help Charles determine the value of the numerator of the fraction .
입력
The first and only line contains an integer ().
출력
The value can be written as a fraction of the form , where and are coprime. Print a line containing the value of a.