#include <bits/stdc++.h>
int main() {
  int a[1010] = {0};
  int n;
  int i, j;
  while (~scanf("%d", &n)) {
    j = 0;
    for (i = 0; i < 1000; i++) {
      j++;
      if (j < 10) {
        a[i] = j;
      } else if (j < 100) {
        a[i] = j / 10;
        a[++i] = j % 10;
      } else if (j < 1000) {
        a[i] = j / 100;
        a[++i] = (j / 10) % 10;
        a[++i] = j % 10;
      }
    }
    printf("%d\n", a[n - 1]);
  }
  return 0;
}
