#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
string hey(int x) {
  string s;
  while (x) {
    s.push_back((x % 10) + '0');
    x /= 10;
  }
  reverse(s.begin(), s.end());
  return s;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  string s = "$";
  for (int i = 1; i <= 1000; i++) {
    s += hey(i);
  }
  int n;
  cin >> n;
  cout << s[n];
  return 0;
}
