#include <bits/stdc++.h>
using namespace std;
long long int a[10000];
int main() {
  int i, n, p, q, c = 1;
  a[0] = 0;
  for (i = 1; i <= 1000; i++) {
    if (i >= 1 && i <= 9) a[c++] = i;
    if (i > 9 && i <= 99) {
      p = i / 10;
      a[c++] = p;
      p = i % 10;
      a[c++] = p;
    } else if (i > 99 && i <= 999) {
      p = i / 100;
      a[c++] = p;
      q = i % 100;
      p = q / 10;
      a[c++] = p;
      p = i % 10;
      a[c++] = p;
    } else if (i == 1000) {
      a[c++] = 1;
      a[c++] = 0;
      a[c++] = 0;
      a[c++] = 0;
    }
  }
  cin >> n;
  cout << a[n] << endl;
}
