#include <bits/stdc++.h>
using namespace std;
const long M = 1000000007;
int main() {
  string s = "123456789";
  int f = 10;
  for (int c = s.size(); c <= 1000; c++) {
    s += to_string(f);
    f++;
  }
  int x;
  cin >> x;
  cout << s[x - 1];
}
