n = int(input()) sequence = [7, 1, 4, 5, 5, 4, 1, 1, 4, 5] print(sequence[n-1])