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