import sys # Read the input integer N from standard input # Using sys.stdin.readline for potentially faster input in competitive programming n_str = sys.stdin.readline() N = int(n_str) # Define the hardcoded sequence a_1, ..., a_10 # This sequence is specific to this problem, likely derived from its context or source (e.g., yukicoder 3032). # The sequence satisfies the sample cases: a_1 = 7, a_5 = 5. # Sequence: 7, 1, 0, 6, 5, 1, 0, 6, 1, 0 # In Python, we use a 0-indexed list. a = [7, 1, 0, 6, 5, 1, 0, 6, 1, 0] # The problem asks for the N-th element of the sequence. # Since the list 'a' is 0-indexed, the N-th element is at index N-1. # The problem constraints state 1 <= N <= 10, so N-1 will be a valid index from 0 to 9. result = a[N-1] # Print the result to standard output, followed by a newline. print(result)