#include <bits/stdc++.h>
int main() {
  int n;
  char a[1009] =
      "012345678910111213141516171819202122232425262728293031323334353637383940"
      "414243444546474849505152535455565758596061626364656667686970717273747576"
      "777879808182838485868788899091929394959697989910010110210310410510610710"
      "810911011111211311411511611711811912012112212312412512612712812913013113"
      "213313413513613713813914014114214314414514614714814915015115215315415515"
      "615715815916016116216316416516616716816917017117217317417517617717817918"
      "018118218318418518618718818919019119219319419519619719819920020120220320"
      "420520620720820921021121221321421521621721821922022122222322422522622722"
      "822923023123223323423523623723823924024124224324424524624724824925025125"
      "225325425525625725825926026126226326426526626726826927027127227327427527"
      "627727827928028128228328428528628728828929029129229329429529629729829930"
      "030130230330430530630730830931031131231331431531631731831932032132232332"
      "432532632732832933033133233333433533633733833934034134234334434534634734"
      "8349350351352353354355356357358359360361362363364365366367368369370371";
  while (scanf("%d", &n) != EOF) {
    printf("%c\n", a[n]);
  }
}
