D = int(input()) C10_list = list(range(0,D+1)) C10_str = "" for i in range(len(C10_list)): C10_str += str(i) print(C10_str[D])