#include #include #include #include #include #include #include #include #include using namespace std; int main(){ cin.tie(0); ios::sync_with_stdio(false); int d; cin >> d; string s=""; int id=0; while(1){ id++; s+=to_string(id); if(id>=150)break; } cout << s[d-1] << endl; return 0; }