# -*- coding: utf-8 -*- d = int(input()) champ = "" for i in range(1,d+1): champ += str(i) champ = list(champ) print(champ[d-1])