def get_data(): D = int(input()) return D def list_num(D): l = [] for i in range(D): l = l + list(f"{i+1}") return l def main(): D = get_data() l = list_num(D) print(l[D - 1]) if __name__=='__main__': main()