import java.util.Scanner; public class No756 { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int c = sc.nextInt(); String str = ""; for( int i = 0; i <= c; i++ ) { str += i; } System.out.println( str.substring( c, c+1 ) ); // c番目の文字を表示 } }