#include <iostream>
#include<algorithm>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
a[0]=1;
a[1]=1;
for(int i=2;i<n;i++){
a[i]=(a[i-1]+a[i-2])%10007;
}
cout<<a[n-1];
}
10-01
361
02-23
458
11-05
1268