#include <stdio.h> int main() { int n, b; scanf("%d", &n); int a[n]; a[0] = a[1] = 1; for (int i = 2; i < n; i++) { a[i] = (a[i - 1] + a[i - 2]) % 10007; b = a[i]; } if (n > 2) printf("%d", b); else printf("1"); return 0; }