import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));![업로드중..](blob:https://velog.io/686fa8fc-e346-43c1-9e50-f61191d578ae)
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
int a = Integer.parseInt(br.readLine());
if( (a%4 == 0 && a%100 != 0 ) || (a%400 == 0)){
bw.write("1");
}else {
bw.write("0");
}
bw.flush();
bw.close();
}
}