#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s = "";
  for (int i = 1; i <= 400; i++) {
    string x;
    stringstream ss;
    ss << i;
    x = ss.str();
    s += x;
  }
  cout << s[n - 1];
  return 0;
}
