import java.util.Scanner; public class d580 { public static void main(String[] args){ Scanner kin = new Scanner(System.in); d580 s1 = new d580(); while(kin.hasNext()){ long n = kin.nextLong(); System.out.println((s1.T(n))%2012); } } public long T(long n){ if(n>=2) return T(n-1)+T(n-2); else return 1; } }