import java.util.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc = new Scanner(System.in); int digit = sc.nextInt(); String linkingSentence = ""; for (int i = 0; i <= digit; i++) { linkingSentence += i; } System.out.println(linkingSentence.substring(digit, digit+1)); } }