#include <iostream>
#include <string>
#include <stack>
using namespace std;
string s;
void add(string & s,int i){
stack<char> stk;
用栈调整一下顺序
while(i){
int c = i % 10;
char ch = c + '0';
stk.push(ch);
i = i / 10;
}
while(!stk.empty()){
auto t = stk.top();
stk.pop();
s += t;
}
}
int main() {
for(int i = 1;i < 1000;i++){
add(s,i);
}
int n;
cin>>n;
cout<<s[n - 1];
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号