#include <bits/stdc++.h>
using namespace std;
int ans[101000];
void solve() {
  int k = 1;
  for (int i = 1; i <= 1000; i++) {
    char ch[100];
    sprintf(ch, "%d", i);
    int len = strlen(ch);
    for (int j = 0; j < len; j++) {
      ans[k++] = ch[j] - '0';
    }
  }
}
int main() {
  solve();
  int n;
  while (cin >> n) cout << ans[n] << endl;
  return 0;
}
