#include <bits/stdc++.h>
const long long mod = 1e9 + 7;
const int maxn = 1e5 + 100;
using namespace std;
int main() {
  int a[20000];
  int n, p = 1;
  cin >> n;
  for (int i = 1; i <= 9; i++) a[p++] = i;
  for (int i = 10; i < 100; i++) {
    a[p++] = i / 10;
    a[p++] = i % 10;
  }
  for (int i = 100; i < 1000; i++) {
    a[p++] = i / 100;
    a[p++] = i / 10 % 10;
    a[p++] = i % 10;
  }
  cout << a[n];
  return 0;
}
