import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int [] dp = new int[1000001];
dp[1] = 1; //1
dp[2] = 2;
if(n >= 3) {
for(int i=3; i<=n; i++) {
dp[i] = (dp[i-2] + dp[i-1])%15746;
}
}
System.out.println(dp[n]);
}
}
2023-04-07