#include <bits/stdc++.h>
using namespace std;
int N;
string S = "";
int main() {
  cin >> N;
  for (int i = 1; i < 1000; i++) {
    string s = "";
    for (int j = i; j > 0; j /= 10) s = (char)(j % 10 + '0') + s;
    S += s;
  }
  cout << S[N - 1] << "\n";
  return 0;
}
