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