#include #include #include int main(){ int i,k=0,d; char str[128]; scanf("%d",&d); for(i=1;k+1>=d;i++){ sprintf(&str[k],"%d",i); k+=floor(log(i)/log(10)); } printf("%d",str[d-1]); return 0; }