import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); StringBuilder sb = new StringBuilder(); int i = 1; while(sb.length() <= n) { sb.append(Integer.toString(i)); i++; } System.out.println(sb.charAt(n - 1)); } }