#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr << #x << ": " << (x) << endl
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define dwn(i,a,b) for(int i=(a);i>=(b);i--)
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define x first
#define y second
using pii = pair<int, int>;
using ll = long long;
inline void read(int &x){
int s=0; x=1;
char ch=getchar();
while(ch<'0' || ch>'9') {if(ch=='-')x=-1;ch=getchar();}
while(ch>='0' && ch<='9') s=(s<<3)+(s<<1)+ch-'0',ch=getchar();
x*=s;
}
const int N=4040, mod=100007;
int n;
int f[N][2];
int add(int a, int b){
return (a+b)%mod;
}
int mul(int a, int b){
return 1LL*a*b%mod;
}
int get(int x){
if(!x) return 1;5
return add(f[x][0], f[x][1]);
}
signed main(){
cin>>n;
--n;
f[1][0]=1;
f[1][1]=1;
rep(i, 1, n-1){
f[i+1][0]=add(f[i+1][0], mul(2, f[i][0]));
f[i+1][1]=add(f[i+1][1], f[i][0]);
f[i+1][0]=add(f[i+1][0], f[i][1]);
f[i+1][1]=add(f[i+1][1], f[i][1]);
}
int res=0;
rep(l, 1, n) rep(r, l+1, n){
int fir=l-1;
int sec=n-r;
res=add(res, mul(get(fir), get(sec)));
}
cout<<res;
return 0;
}