#include<bits/stdc++.h>
using namespace std;
#define endl "\n"

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0),cout.tie(0);
    int n;
    cin >> n;
    if(n<10){
        cout << n << endl;
    }else if(n>=10&&n<=189){
        int i = (n - 9) / 2 + 9;
        int x = (n - 9) % 2;
        if(x==0){
            cout << i % 10 << endl;
        }else{
            cout << (i + 1) / 10 << endl;
        }
    }else{
        int i = (n - 189) / 3 + 99;
        int x = (n - 189) % 3;
        if(x==0){
            cout << i % 10 << endl;
        }else if(x==1){
            i++;
            cout << i / 100 << endl;
        }else{
            i++;
            cout << (i / 10) % 10<< endl;
        }
    }
    return 0;
}

刚一开始看这个题以为要进行拼接字符串,但发现不会拼(会的可以教教我这个题咋拼接字符串)于是我看到n的范围,就想到可以直接划分范围分情况讨论,例如每次+1,+2,+3,以此类推,再讨论n位于该数的的那个位置十位,个位....以此类推就可以了