import java.util.Scanner; class Main { static char C[] = new char[101]; static int top = 0; public static void push(int i) { String tmp = String.valueOf(i); for (int j = 0; j < tmp.length(); ++j) { C[top] = tmp.charAt(j); ++top; } } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int D = sc.nextInt(); sc.close(); for (int i = 1; i <= 55; ++i) push(i); System.out.print(C[D - 1]); } }