#include <bits/stdc++.h>
using namespace std;
int a[100005], b[5];
int main() {
  int i, ii, kk = 1, k, j;
  for (i = 1; i <= 400; i++) {
    k = 0, ii = i;
    while (ii) {
      b[k++] = ii % 10;
      ii /= 10;
    }
    for (j = k - 1; j >= 0; j--) {
      a[kk++] = b[j];
    }
  }
  int n;
  scanf("%d", &n);
  printf("%d\n", a[n]);
}
