#include <bits/stdc++.h>
using namespace std;
int ans;
int main() {
  int n, j = 9;
  cin >> n;
  int a[10000] = {1, 2, 3, 4, 5, 6, 7, 8, 9};
  for (int i = 10; i < 100; i++) {
    a[j] = i / 10;
    a[j + 1] = i % 10;
    j += 2;
  }
  for (int i = 100; i < 1000; i++) {
    a[j] = i / 100;
    ans = i / 10;
    a[j + 1] = ans % 10;
    a[j + 2] = i % 10;
    j += 3;
  }
  cout << a[n - 1];
  return 0;
}
