#include <bits/stdc++.h>
using namespace std;
string s, s1;
int add = 1;
int main() {
  while (s.size() < 1000) {
    s1 = "";
    int tmp = add;
    while (tmp) {
      s1 += (tmp % 10 + '0');
      tmp /= 10;
    }
    reverse(s1.begin(), s1.end());
    s += s1;
    add++;
  }
  int n;
  scanf("%d", &n);
  cout << s[n - 1] << endl;
  return 0;
}
