#include <bits/stdc++.h>
using namespace std;
int main() {
  double n1;
  int m, n;
  cin >> n;
  if (n <= 9) {
    cout << n;
    return 0;
  } else if (n <= 189) {
    n1 = n - 9;
    n1 = ceil(n1 / 2.0);
    m = 9 + n1;
    if (n % 2 == 0)
      cout << m / 10;
    else
      cout << m % 10;
  } else {
    n1 = n - 189;
    n1 = ceil(n1 / 3.0);
    m = 99 + n1;
    if (n % 3 == 0)
      cout << m % 10;
    else if (n % 3 == 1) {
      cout << m / 100;
    } else
      cout << (m / 10) % 10;
  }
}
