#include <bits/stdc++.h>
char s[1000001];
int main() {
  int p = 0;
  for (int i = 1; i <= 1000; ++i) {
    sprintf(s + p, "%d", i);
    int l = strlen(s + p);
    p += l;
  }
  int n;
  scanf("%d", &n);
  printf("%c\n", s[n - 1]);
}
