https://www.acmicpc.net/problem/11726
n=int(input()) num=[0]*1002 num[1]=1 num[2]=2 for i in range(3,n+1): num[i]=(num[i-1]+num[i-2])%10007 print(num[n])