import java.io.*; import java.util.Scanner; public class Main_yukicoder756 { private static Scanner sc; private static Printer pr; private static void solve() { int d = sc.nextInt(); StringBuilder c10 = new StringBuilder(); for (int i = 1; c10.length() < d; i++) { c10.append(i); } pr.println(c10.charAt(d - 1)); } // --------------------------------------------------- public static void main(String[] args) { sc = new Scanner(System.in); pr = new Printer(System.out); solve(); pr.close(); sc.close(); } static class Printer extends PrintWriter { Printer(OutputStream out) { super(out); } } }