#include <bits/stdc++.h>
using namespace std;
char ch[40000];
char cur[10];
void process() {
  for (int i = 1; i <= 1000; i++) {
    int pos = 0;
    int cur_num = i;
    while (cur_num != 0) {
      int cur_dig = cur_num % 10;
      cur_num /= 10;
      cur[pos++] = cur_dig + '0';
    }
    reverse(cur, cur + pos);
    cur[pos] = '\0';
    strcat(ch, cur);
  }
}
int main() {
  process();
  int n;
  cin >> n;
  cout << ch[n - 1] << endl;
  return 0;
}
