s = "1000000007" n = int(input()) print(s[-n])