#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s = "";
  int r = 1;
  while (s.size() < 1050) {
    int k = r;
    string t = "";
    while (k > 0) {
      t = char((k % 10) + '0') + t;
      k = k / 10;
    }
    s = s + t, r++;
  }
  cout << s[n - 1];
  return 0;
}
