#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a, i, b, c;
  char s[1001];
  a = 1;
  i = 1;
  while (i < 1001) {
    c = a;
    b = 0;
    c = c * 10 + 1;
    while (c > 0) {
      b = b * 10 + c % 10;
      c = c / 10;
    }
    while (b > 9) {
      s[i] = b % 10;
      b = b / 10;
      i++;
    }
    a++;
  }
  scanf("%d", &n);
  printf("%d", s[n]);
}
