#include <bits/stdc++.h>   using namespace std;   int main() {     pair<long long, long long> a[1001];     a[0].second = 1;     for (long long i = 1; i < 1001; i++) {       a[i].first = i;       if (i < 10)         a[i].second = 1;       else if (i < 100)         a[i].second = 2;       else if (i < 1000)         a[i].second = 3;     }     long long n;     cin >> n;     long long count = 1;     long long i = 1;     while (count < n) {       count += a[i].second;       i++;     }     if (count == n) {       long long temp = i;       long long ans;       while (temp != 0) {         ans = temp % 10;         temp = temp / 10;       }       cout << ans << endl;     } else if (count > n) {       i--;       long long temp = a[i].first;       long long flag = count - n - 1;       while (flag > 0) {         temp = temp / 10;         flag--;       }       cout << temp % 10 << endl;     }   }   