n = int(input()) # s = '-7000500000' #1,4,5 s = '-7xxx5xx0??' print(s[n])