#include <bits/stdc++.h>
using namespace std;
vector<int> sol = {0};
void razlozi(int a) {
  vector<int> tmp;
  while (a) {
    tmp.push_back(a % 10);
    a /= 10;
  }
  reverse(tmp.begin(), tmp.end());
  for (auto& i : tmp) sol.push_back(i);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n;
  cin >> n;
  for (int i = 1; i <= 1000; ++i) {
    razlozi(i);
  }
  cout << sol[n] << '\n';
}
