#include <bits/stdc++.h>
using namespace std;
long long int k, n, i, j, a, b, c, h, m, sum;
const int maxn = 1000;
int e[maxn][maxn];
int q[maxn];
int w[maxn];
int main() {
  cin >> n;
  if (n <= 9) {
    cout << n;
    return 0;
  }
  if (n <= 189) {
    n = n - 9;
    if (n % 2 == 1) {
      n = (n + 1) / 2;
      n = n + 9;
      n = n / 10;
      cout << n;
      return 0;
    } else {
      n = n / 2;
      n = n + 9;
      for (i = 0; i < 10; i++) {
        if (n % 10 == i) {
          cout << i;
          return 0;
        }
      }
    }
  } else {
    n = n - 189;
    if (n % 3 == 1) {
      n = (n + 2) / 3;
      n = 99 + n;
      n = n / 100;
      cout << n;
      return 0;
    }
    if (n % 3 == 0) {
      n = n / 3;
      n = n + 99;
      for (i = 0; i < 10; i++) {
        if (n % 10 == i) {
          cout << i;
          return 0;
        }
      }
    }
    if (n % 3 == 2) {
      n = (n + 1) / n;
      n = 99 + n;
      n = n / 10;
      for (i = 0; i < 10; i++) {
        if (n % 10 == i) {
          cout << i;
          return 0;
        }
      }
    }
  }
}
