#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int x[n];
  int i = 0, j = 0;
  while (i <= n + 1) {
    if (j >= 0 && j <= 9) {
      x[i] = j;
      i++;
    } else if (j > 9 && j <= 99) {
      x[i] = j / 10;
      x[i + 1] = j % 10;
      i += 2;
    } else if (j > 99 && j < 900) {
      x[i] = j / 100;
      x[i + 1] = (j % 10) / 10;
      x[i + 2] = (j % 10) % 10;
      i += 3;
    }
    j++;
  }
  cout << x[n];
  return 0;
}
