#include <bits/stdc++.h>
using namespace std;
int main() {
  int c = 0, a, sum = 0, n, b, ll;
  string s;
  cin >> n;
  for (int i = 1; i < 1000; i++) {
    int x = i;
    while (x) {
      x /= 10;
      c++;
    }
    if (c >= n) {
      int p = c - n;
      for (int j = 1; j <= p + 1; j++) {
        ll = i % 10;
        i /= 10;
      }
      cout << ll << endl;
      return 0;
    } else {
      sum += c;
    }
  }
  return 0;
}
