#include <bits/stdc++.h>
using namespace std;
string tokek(int x) {
  string res = "";
  while (x > 0) {
    res = (char)(x % 10 + '0') + res;
    x /= 10;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  string s;
  for (int i = 1; s.length() <= 1000; i++) s += tokek(i);
  int n;
  cin >> n;
  cout << s[n - 1] << endl;
  return 0;
}
