#include <bits/stdc++.h>
using namespace std;
vector<int> a;
void init(int x) {
  vector<int> b;
  while (x > 0) {
    int tmp = x % 10;
    b.push_back(tmp);
    x /= 10;
  }
  for (int i = b.size() - 1; i >= 0; i--) {
    a.push_back(b[i]);
  }
}
int main() {
  for (int i = 0; i <= 1000; ++i) init(i);
  int n;
  while (~scanf("%d", &n)) cout << a[n - 1] << endl;
  return 0;
}
