#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
const int N = 1e5 + 100;
int solve(int n) {
  if (n < 10) return n;
  if (n < 190) {
    n -= 10;
    int t = 10 + n / 2;
    return (n & 1) ? t % 10 : t / 10;
  }
  n -= 190;
  int t = 100 + n / 3;
  if (n % 3 == 0) return t / 100;
  if (n % 3 == 1) return t / 10 % 10;
  return t % 10;
}
int main() {
  int i, j;
  int n;
  cin >> n;
  cout << solve(n) << endl;
  return 0;
}
