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