#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t = 1;
  while (t--) {
    vector<long long> w;
    int n;
    cin >> n;
    for (int i = 1; i <= 999; ++i) {
      if (i < 10) {
        w.push_back(i);
      }
      if (i < 100 && i > 9) {
        w.push_back(i / 10);
        w.push_back(i % 10);
      }
      if (i < 1000 && i > 99) {
        w.push_back(i / 100);
        w.push_back((i % 100) / 10);
        w.push_back(i % 10);
      }
    }
    cout << w[n - 1];
    cout << "\n";
  }
}
