#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, r, x;
  vector<int> a;
  vector<int> b;
  for (int i = 1; i <= 1000; i++) {
    m = i;
    while (m) {
      r = m % 10;
      b.push_back(r);
      m = m / 10;
    }
    x = b.size() - 1;
    while (x >= 0) {
      m = b[x];
      a.push_back(m);
      x--;
    }
    b.clear();
  }
  cin >> n;
  cout << a[n - 1] << endl;
  return 0;
}
