# Predefined sequence based on the problem's context and examples sequence = [7, 1, 1, 4, 5, 1, 4, 1, 1, 4] # Read input n = int(input()) # Output the nth element (adjusting for 0-based index) print(sequence[n - 1])