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