#include <stdio.h> int main( void ) { unsigned n; scanf( "%u", &n ); unsigned r = 0; for( unsigned a=1, i=0; i!=n; ++i ) { r = r+a; a = r-a; r %= 10007; } printf( "%u\n", r ); return 0; }