#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<int> v;
  long long i = 1;
  while (i < 1000) {
    if (i <= 9)
      v.push_back(i);
    else if (i <= 99) {
      long long a = i / 10, b = i % 10;
      v.push_back(a);
      v.push_back(b);
    } else {
      long long a, b, c, d;
      a = i % 10;
      b = i / 100;
      c = i / 10;
      d = c % 10;
      v.push_back(b);
      v.push_back(d);
      v.push_back(a);
    }
    i++;
  }
  long long n;
  cin >> n;
  cout << v[n - 1];
}
