#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, c = 0, d = 1;
  cin >> n;
  int i = 0;
  while (n != 0) {
    i++;
    if (i == 10 || i == 100 || i == 1000) {
      d++;
    }
    if (n <= d) {
      string x = to_string(i);
      cout << x[n - 1] - 48 << endl;
      break;
    }
    n -= d;
  }
}
