import time

n = int(input())

if n == 1:
    pass  # Minimal time and memory
elif n == 2:
    # Simulate CPU-intensive operations for approximately 3 seconds
    start_time = time.perf_counter()
    while time.perf_counter() - start_time < 2.95:
        pass
elif n == 3:
    # Allocate 100MB of memory
    data = bytearray(100000000)  # 100,000,000 bytes = 100MB
elif n == 4:
    # Allocate and process 100MB of memory
    data = bytearray(100000000)
    for i in range(len(data)):
        data[i] ^= 0xFF  # XOR each byte to ensure computation
elif n == 5:
    # Combine memory allocation and intensive computation
    data = bytearray(100000000)
    for i in range(len(data)):
        data[i] ^= 0xFF
    start_time = time.perf_counter()
    while time.perf_counter() - start_time < 2.95:
        pass

print(0)