#include <bits/stdc++.h>using namespace std;int main(int argc, char** argv){int b[10000],a;for(int c=0;c<=10000;c++)if(c==0||c==1) b[c]=1;else b[c]=(b[c-2]+b[c-1])%2012;while(cin>>a)cout<<b[a]<<endl;}