using System; using System.Text; class Program { public void Solve() { int D = int.Parse(Console.ReadLine()); var C = new StringBuilder(); for (int i = 1; ; i++) { C.Append(i.ToString()); if (D <= C.Length) { break; } } Console.WriteLine(C.ToString().Substring(D-1, 1)); } static void Main() { var solver = new Program(); solver.Solve(); } }