Given n up to 116, compute the n-th term of the recurrence f(n) = f(n-1) + f(n-3) with f(1)=f(2)=f(3)=1.
The Fibonacci-like sequence is defined by f(n)=f(n−1)+f(n−3)f(n) = f(n-1) + f(n-3)f(n)=f(n−1)+f(n−3), with f(1)=f(2)=f(3)=1f(1) = f(2) = f(3) = 1f(1)=f(2)=f(3)=1. Its first terms are:
1, 1, 1, 2, 3, 4, 6, 9, 13, 19, ...
Given a positive integer nnn, find the nnn-th term of the Fibonacci-like sequence.
The first line contains a positive integer nnn (1≤n≤1161 \le n \le 1161≤n≤116).
Print the nnn-th term of the Fibonacci-like sequence.